From 4cb4e9f8d4fde97dfb238813b3d4caeb9f578822 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Fri, 22 Feb 2013 19:53:47 +0000 Subject: [PATCH] watch focus event --- x.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x.c b/x.c index 21265a6..0b5d624 100644 --- a/x.c +++ b/x.c @@ -443,6 +443,10 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback, context_menu(); } break; + case FocusIn: + case FocusOut: + printf("Focus Event\n"); + wake_up(); } } return true; @@ -688,7 +692,7 @@ void x_win_setup(void) wa.background_pixmap = ParentRelative; wa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask | - ButtonPressMask; + ButtonPressMask | FocusChangeMask; screen_info scr; x_screen_info(&scr); @@ -704,6 +708,9 @@ void x_win_setup(void) setopacity(xctx.win, (unsigned long)((100 - settings.transparency) * (0xffffffff / 100))); + + long root_event_mask = FocusChangeMask; + XSelectInput(xctx.dpy, root, root_event_mask); } /*