From 1801a8be46237576f0a274fe6ef46f529068e220 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 19 Oct 2011 14:55:57 +0200 Subject: [PATCH] Add a define for the root window's event mask Signed-off-by: Uli Schlachter --- awesome.c | 13 +------------ globalconf.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/awesome.c b/awesome.c index 2689586f0..26598bf77 100644 --- a/awesome.c +++ b/awesome.c @@ -553,21 +553,10 @@ main(int argc, char **argv) scan(); { - /* select for events */ - const uint32_t change_win_vals[] = - { - XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY - | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW - | XCB_EVENT_MASK_STRUCTURE_NOTIFY - | XCB_EVENT_MASK_BUTTON_PRESS - | XCB_EVENT_MASK_BUTTON_RELEASE - | XCB_EVENT_MASK_FOCUS_CHANGE - }; - xcb_change_window_attributes(globalconf.connection, globalconf.screen->root, XCB_CW_EVENT_MASK, - change_win_vals); + ROOT_WINDOW_EVENT_MASK); } /* we will receive events, stop grabbing server */ diff --git a/globalconf.h b/globalconf.h index b231accfb..212511293 100644 --- a/globalconf.h +++ b/globalconf.h @@ -34,6 +34,17 @@ #include "color.h" #include "common/xembed.h" +#define ROOT_WINDOW_EVENT_MASK \ + (const uint32_t []) { \ + XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY \ + | XCB_EVENT_MASK_ENTER_WINDOW \ + | XCB_EVENT_MASK_LEAVE_WINDOW \ + | XCB_EVENT_MASK_STRUCTURE_NOTIFY \ + | XCB_EVENT_MASK_BUTTON_PRESS \ + | XCB_EVENT_MASK_BUTTON_RELEASE \ + | XCB_EVENT_MASK_FOCUS_CHANGE \ + } + typedef struct drawin_t drawin_t; typedef struct a_screen screen_t; typedef struct button_t button_t;