mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
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.
This commit is contained in:
parent
20997df416
commit
0a388a14f1
@ -57,11 +57,11 @@ struct wlr_xwayland {
|
|||||||
} events;
|
} events;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a custom event handler to xwayland. Return 1 if the event was
|
* Add a custom event handler to xwayland. Return true if the event was
|
||||||
* handled or 0 to use the default wlr-xwayland handler. wlr-xwayland will
|
* handled or false to use the default wlr-xwayland handler. wlr-xwayland will
|
||||||
* free the event.
|
* 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;
|
void *data;
|
||||||
|
|
||||||
|
@ -1747,7 +1747,7 @@ static int x11_event_handler(int fd, uint32_t mask, void *data) {
|
|||||||
count++;
|
count++;
|
||||||
|
|
||||||
if (xwm->xwayland->user_event_handler &&
|
if (xwm->xwayland->user_event_handler &&
|
||||||
xwm->xwayland->user_event_handler(xwm, event)) {
|
xwm->xwayland->user_event_handler(xwm->xwayland, event)) {
|
||||||
free(event);
|
free(event);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user