diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-12-13 19:33:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 19:33:01 -0500 |
commit | 16ee728f57dbb36429f32e745fe040f364545702 (patch) | |
tree | acbfa32bbd367b66344a42ea7f265a14af818b52 /xwayland/xwm.c | |
parent | 96f09c749228f631e3a160de370e2894a4428e20 (diff) | |
parent | ea4b871e16ae63db67f2bf89c00e814b3dde6c78 (diff) |
Merge pull request #486 from acrisci/feature/xwm-custom-event-loop
xwm: user custom event handler
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index a86fbd0e..54092cda 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -12,7 +12,7 @@ #include "wlr/types/wlr_surface.h" #include "wlr/xwayland.h" #include "wlr/xcursor.h" -#include "xwm.h" +#include "wlr/xwm.h" #ifdef HAS_XCB_ICCCM #include <xcb/xcb_icccm.h> @@ -938,6 +938,12 @@ static int x11_event_handler(int fd, uint32_t mask, void *data) { while ((event = xcb_poll_for_event(xwm->xcb_conn))) { count++; + + if (xwm->xwayland->user_event_handler && + xwm->xwayland->user_event_handler(xwm, event)) { + break; + } + switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_CREATE_NOTIFY: xwm_handle_create_notify(xwm, (xcb_create_notify_event_t *)event); |