watch focus event

This commit is contained in:
Sascha Kruse 2013-02-22 19:53:47 +00:00
parent f12d5332a8
commit 4cb4e9f8d4

9
x.c
View File

@ -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);
}
/*