]> Dogcows Code - chaz/openbox/commitdiff
dont cause focus change with enter events when youre already in the window
authorDana Jansens <danakj@orodu.net>
Tue, 24 Apr 2007 20:39:59 +0000 (20:39 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 24 Apr 2007 20:39:59 +0000 (20:39 +0000)
openbox/event.c
openbox/frame.c

index 2d807aae23fc7c755431b306882a50a76b910a7a..c3fab03e19819ecb56273a60bdf848e56bb9b7f4 100644 (file)
@@ -761,9 +761,9 @@ static void event_handle_client(ObClient *client, XEvent *e)
             if (keyboard_interactively_grabbed())
                 break;
             if (config_focus_follow && config_focus_delay &&
-                /* leaveinferior events can happen when the mouse goes onto the
-                   window's border and then into the window before the delay
-                   is up */
+                /* leave inferior events can happen when the mouse goes onto
+                   the window's border and then into the window before the
+                   delay is up */
                 e->xcrossing.detail != NotifyInferior)
             {
                 ob_main_loop_timeout_remove_data(ob_main_loop,
@@ -810,7 +810,9 @@ static void event_handle_client(ObClient *client, XEvent *e)
             if (keyboard_interactively_grabbed())
                 break;
             if (e->xcrossing.mode == NotifyGrab ||
-                e->xcrossing.mode == NotifyUngrab)
+                e->xcrossing.mode == NotifyUngrab ||
+                /*ignore enters when we're already in the window */
+                e->xcrossing.detail == NotifyInferior)
             {
                 ob_debug_type(OB_DEBUG_FOCUS,
                               "%sNotify mode %d detail %d on %lx IGNORED\n",
index eb223f64737e90ce0e0ef15eda752ba37081e48c..cdacf101c70d6b9afad7bb9766db9470f4701701 100644 (file)
 #define ELEMENT_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
                            ButtonMotionMask | \
                            EnterWindowMask | LeaveWindowMask)
+/* The inner window does not need enter/leave events.
+   If it does get them, then it needs its own context for enter events
+   because sloppy focus will focus the window when you enter the inner window
+   from the frame. */
+#define INNER_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
+                         ButtonMotionMask)
 
 #define FRAME_HANDLE_Y(f) (f->innersize.top + f->client->area.height + \
                            f->cbwidth_y)
@@ -100,7 +106,7 @@ ObFrame *frame_new(ObClient *client)
     self->window = createWindow(RootWindow(ob_display, ob_screen), visual,
                                 mask, &attrib);
 
-    attrib.event_mask = ELEMENT_EVENTMASK;
+    attrib.event_mask = INNER_EVENTMASK;
     self->inner = createWindow(self->window, visual, mask, &attrib);
 
     mask &= ~CWEventMask;
This page took 0.02861 seconds and 4 git commands to generate.