From 0a388a14f1e1678d9b2c368fd14be7c9a9726a53 Mon Sep 17 00:00:00 2001 From: Consolatis <40171-Consolatis@users.noreply.gitlab.freedesktop.org> Date: Mon, 29 Apr 2024 10:57:08 +0200 Subject: [PATCH] xwm: supply wlr_xwayland pointer to user_event_handler callback Previously it was supplying a pointer to private struct wlr_xwm which was useless for compositors. The wlr_xwayland pointer in contrast does have a generic data field and thus can be used by compositors to attach their own pointer. Additionally change the return value from int to bool. --- include/wlr/xwayland/xwayland.h | 6 +++--- xwayland/xwm.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wlr/xwayland/xwayland.h b/include/wlr/xwayland/xwayland.h index b38cc74f..fb8bca08 100644 --- a/include/wlr/xwayland/xwayland.h +++ b/include/wlr/xwayland/xwayland.h @@ -57,11 +57,11 @@ struct wlr_xwayland { } events; /** - * Add a custom event handler to xwayland. Return 1 if the event was - * handled or 0 to use the default wlr-xwayland handler. wlr-xwayland will + * Add a custom event handler to xwayland. Return true if the event was + * handled or false to use the default wlr-xwayland handler. wlr-xwayland will * free the event. */ - int (*user_event_handler)(struct wlr_xwm *xwm, xcb_generic_event_t *event); + bool (*user_event_handler)(struct wlr_xwayland *wlr_xwayland, xcb_generic_event_t *event); void *data; diff --git a/xwayland/xwm.c b/xwayland/xwm.c index d0fca483..d16185d4 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1747,7 +1747,7 @@ static int x11_event_handler(int fd, uint32_t mask, void *data) { count++; if (xwm->xwayland->user_event_handler && - xwm->xwayland->user_event_handler(xwm, event)) { + xwm->xwayland->user_event_handler(xwm->xwayland, event)) { free(event); continue; }