diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-09-10 13:45:18 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-09-10 13:45:18 +0000 |
commit | 44e2b53f83f6c6b8467aec4c367700c89986e938 (patch) | |
tree | 0f11c596076cf8931b5d87e21c6910671f8331c8 /gdk | |
parent | c2b02b560b7258c1a574de53f7813a0f8dd59686 (diff) | |
download | gtk+-44e2b53f83f6c6b8467aec4c367700c89986e938.tar.gz |
Take focus mode into account when tracking FocusIn/Out events, so we don't
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
focus mode into account when tracking FocusIn/Out events,
so we don't get confused by focus changes while a
keyboard grab is in effect. (Probably fixes #90563)
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdkevents-x11.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 0c278112cb..9fbca311c3 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -1072,10 +1072,20 @@ gdk_event_translate (GdkDisplay *display, case NotifyNonlinear: case NotifyVirtual: case NotifyNonlinearVirtual: - window_impl->has_focus = TRUE; + /* We pretend that the focus moves to the grab + * window, so we pay attention to NotifyGrab + * NotifyUngrab, and ignore NotifyWhileGrabbed + */ + if (xevent->xfocus.mode != NotifyWhileGrabbed) + window_impl->has_focus = TRUE; break; case NotifyPointer: - window_impl->has_pointer_focus = TRUE; + /* The X server sends NotifyPointer/NotifyGrab, + * but the pointer focus is ignored while a + * grab is in effect + */ + if (xevent->xfocus.mode != NotifyGrab) + window_impl->has_pointer_focus = TRUE; break; case NotifyInferior: case NotifyPointerRoot: @@ -1101,10 +1111,12 @@ gdk_event_translate (GdkDisplay *display, case NotifyNonlinear: case NotifyVirtual: case NotifyNonlinearVirtual: - window_impl->has_focus = FALSE; + if (xevent->xfocus.mode != NotifyWhileGrabbed) + window_impl->has_focus = FALSE; break; case NotifyPointer: - window_impl->has_pointer_focus = FALSE; + if (xevent->xfocus.mode != NotifyUngrab) + window_impl->has_pointer_focus = FALSE; break; case NotifyInferior: case NotifyPointerRoot: |