diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-02-12 18:28:25 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-02-12 18:28:25 +0100 |
commit | aa54695f796cb054eaa3472d1df7f6d99572edb5 (patch) | |
tree | 39bccf801c43074c60c91f81284d15c9cf103228 | |
parent | 8386878e30824cceb076c306c63bc0a6b22e0ca2 (diff) | |
download | shelf-aa54695f796cb054eaa3472d1df7f6d99572edb5.tar.gz shelf-aa54695f796cb054eaa3472d1df7f6d99572edb5.tar.bz2 |
Implicitly obey click_to_focus policy by relaying IPW window enter events to its main window.
-rw-r--r-- | shelf.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -33,6 +33,7 @@ #include <X11/extensions/shape.h> #include <X11/cursorfont.h> #include <math.h> +#include <string.h> #include "shelf_options.h" typedef struct _ShelfedWindowInfo { @@ -630,6 +631,20 @@ handleButtonRelease (CompWindow *w) } } +static void +handleWindowEnter (CompWindow *w, + XEvent *event) +{ + XEvent enterEvent; + + memcpy (&enterEvent.xcrossing, &event->xcrossing, + sizeof (XCrossingEvent)); + enterEvent.xcrossing.window = w->id; + + XSendEvent (w->screen->display->display, w->id, + FALSE, EnterWindowMask, &enterEvent); +} + static CompWindow * shelfFindRealWindowID (CompDisplay *d, Window wid) @@ -654,6 +669,11 @@ shelfHandleEvent (CompDisplay *d, switch (event->type) { + case EnterNotify: + w = shelfFindRealWindowID (d, event->xcrossing.window); + if (w) + handleWindowEnter (w, event); + break; case ButtonPress: w = shelfFindRealWindowID (d, event->xbutton.window); if (w) |