From 779c4354c43a06be07424e2c5bbbdda47bc9ab96 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Mon, 25 Feb 2013 21:58:15 +0100 Subject: [PATCH] Wakeup on PropertyNotify This causes dunst to wakeup when _NET_ACTIVE_WINDOW changed so we can check wether we need to move to another monitor. --- x.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x.c b/x.c index 907c4f5..5e2a64c 100644 --- a/x.c +++ b/x.c @@ -508,8 +508,9 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback, break; case FocusIn: case FocusOut: - printf("Focus Event\n"); + case PropertyNotify: wake_up(); + break; } } return true; @@ -755,7 +756,7 @@ void x_win_setup(void) wa.background_pixmap = ParentRelative; wa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask | - ButtonPressMask | FocusChangeMask; + ButtonPressMask | FocusChangeMask| StructureNotifyMask; screen_info scr; x_screen_info(&scr); @@ -772,7 +773,7 @@ void x_win_setup(void) (unsigned long)((100 - settings.transparency) * (0xffffffff / 100))); - long root_event_mask = FocusChangeMask; + long root_event_mask = FocusChangeMask | PropertyChangeMask; XSelectInput(xctx.dpy, root, root_event_mask); }