Add a define for the root window's event mask

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-10-19 14:55:57 +02:00
parent 351fc7aa3a
commit 1801a8be46
2 changed files with 12 additions and 12 deletions

View File

@ -553,21 +553,10 @@ main(int argc, char **argv)
scan(); 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, xcb_change_window_attributes(globalconf.connection,
globalconf.screen->root, globalconf.screen->root,
XCB_CW_EVENT_MASK, XCB_CW_EVENT_MASK,
change_win_vals); ROOT_WINDOW_EVENT_MASK);
} }
/* we will receive events, stop grabbing server */ /* we will receive events, stop grabbing server */

View File

@ -34,6 +34,17 @@
#include "color.h" #include "color.h"
#include "common/xembed.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 drawin_t drawin_t;
typedef struct a_screen screen_t; typedef struct a_screen screen_t;
typedef struct button_t button_t; typedef struct button_t button_t;