# HG changeset patch # User Gerd Moellmann # Date 960497821 0 # Node ID dfb72889ff52448766c49035e252d0a2b1c0606a # Parent e222720769a03beb2cdc95458afd0f65dec106f7 (kbd_buffer_get_event): Handle FOCUS_IN_EVENT by generating a switch-frame event if necessary. diff -r e222720769a0 -r dfb72889ff52 src/keyboard.c --- a/src/keyboard.c Thu Jun 08 20:56:24 2000 +0000 +++ b/src/keyboard.c Thu Jun 08 20:57:01 2000 +0000 @@ -3315,10 +3315,28 @@ obj = Fcons (Qhelp_echo, event->frame_or_window); kbd_fetch_ptr = event + 1; } - /* If this event is on a different frame, return a switch-frame this - time, and leave the event in the queue for next time. */ + else if (event->kind == FOCUS_IN_EVENT) + { + /* Notification of a FocusIn event. The frame receiving the + focus is in event->frame_or_window. Generate a + switch-frame event if necessary. */ + Lisp_Object frame, focus; + + frame = event->frame_or_window; + focus = FRAME_FOCUS_FRAME (XFRAME (frame)); + if (FRAMEP (focus)) + frame = focus; + + if (!EQ (frame, internal_last_event_frame) + && !EQ (frame, selected_frame)) + obj = make_lispy_switch_frame (frame); + internal_last_event_frame = frame; + kbd_fetch_ptr = event + 1; + } else { + /* If this event is on a different frame, return a switch-frame this + time, and leave the event in the queue for next time. */ Lisp_Object frame; Lisp_Object focus;