summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-12 18:28:25 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-12 18:28:25 +0100
commitaa54695f796cb054eaa3472d1df7f6d99572edb5 (patch)
tree39bccf801c43074c60c91f81284d15c9cf103228
parent8386878e30824cceb076c306c63bc0a6b22e0ca2 (diff)
downloadshelf-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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/shelf.c b/shelf.c
index 60b043a..45962fa 100644
--- a/shelf.c
+++ b/shelf.c
@@ -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)