diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 14:59:09 +1000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-09-02 08:50:17 +0200 |
commit | 60a174eb1165f6adc139821c863ff73d57a3ce79 (patch) | |
tree | 4245acf84c3221d186387bd2c6ac4fd536333cf3 | |
parent | 69a5279f7983097e13d194e30f5233898ffa6ff8 (diff) |
xwayland: Introduce request_activate event
-rw-r--r-- | include/wlr/xwayland.h | 1 | ||||
-rw-r--r-- | xwayland/xwm.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 82ca63bc..cf1c2cd1 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -151,6 +151,7 @@ struct wlr_xwayland_surface { struct wl_signal request_resize; struct wl_signal request_maximize; struct wl_signal request_fullscreen; + struct wl_signal request_activate; struct wl_signal map; struct wl_signal unmap; diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 268cb6a2..cebd9bbc 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -148,6 +148,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create( wl_signal_init(&surface->events.request_resize); wl_signal_init(&surface->events.request_maximize); wl_signal_init(&surface->events.request_fullscreen); + wl_signal_init(&surface->events.request_activate); wl_signal_init(&surface->events.map); wl_signal_init(&surface->events.unmap); wl_signal_init(&surface->events.set_class); @@ -1096,6 +1097,15 @@ static void xwm_handle_wm_protocols_message(struct wlr_xwm *xwm, } } +static void xwm_handle_net_active_window_message(struct wlr_xwm *xwm, + xcb_client_message_event_t *ev) { + struct wlr_xwayland_surface *surface = lookup_surface(xwm, ev->window); + if (surface == NULL) { + return; + } + wlr_signal_emit_safe(&surface->events.request_activate, surface); +} + static void xwm_handle_client_message(struct wlr_xwm *xwm, xcb_client_message_event_t *ev) { wlr_log(WLR_DEBUG, "XCB_CLIENT_MESSAGE (%u)", ev->window); @@ -1108,6 +1118,8 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm, xwm_handle_net_wm_moveresize_message(xwm, ev); } else if (ev->type == xwm->atoms[WM_PROTOCOLS]) { xwm_handle_wm_protocols_message(xwm, ev); + } else if (ev->type == xwm->atoms[_NET_ACTIVE_WINDOW]) { + xwm_handle_net_active_window_message(xwm, ev); } else if (!xwm_handle_selection_client_message(xwm, ev)) { char *type_name = xwm_get_atom_name(xwm, ev->type); wlr_log(WLR_DEBUG, "unhandled x11 client message %u (%s)", ev->type, |