From: Dana Jansens Date: Mon, 3 Mar 2008 04:16:40 +0000 (-0500) Subject: set the root event mask to listen for substructure events X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=752cb56f36586e71d38794b04b97e0f221f9286a;p=dana%2Fdcompmgr.git set the root event mask to listen for substructure events --- diff --git a/dcompmgr.c b/dcompmgr.c index 12a711b..38f96e7 100644 --- a/dcompmgr.c +++ b/dcompmgr.c @@ -25,6 +25,8 @@ all_screens(xcb_connection_t *conn, d_screen_t **list) *list = g_renew(d_screen_t, *list, count); (*list)[count-1] = sc; printf(_("managing screen %d\n"), sc.num); + + screen_listen(conn, &sc); } } return count; diff --git a/screen.c b/screen.c index e223467..f268ede 100644 --- a/screen.c +++ b/screen.c @@ -3,6 +3,8 @@ #include #include +#define ROOT_MASK (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY) + gboolean screen_register(xcb_connection_t *conn, d_screen_t *sc) { @@ -48,3 +50,10 @@ screen_register(xcb_connection_t *conn, d_screen_t *sc) return FALSE; } } + +void screen_listen(xcb_connection_t *conn, d_screen_t *sc) +{ + const uint32_t mask = ROOT_MASK; + xcb_change_window_attributes(conn, sc->super.root, + XCB_CW_EVENT_MASK, &mask); +} diff --git a/screen.h b/screen.h index bdf54be..5aed2af 100644 --- a/screen.h +++ b/screen.h @@ -16,4 +16,6 @@ typedef struct { */ gboolean screen_register(xcb_connection_t *conn, d_screen_t *sc); +void screen_listen(xcb_connection_t *conn, d_screen_t *sc); + #endif