From f7deb6a9592cd2dff480b80f2887ceab8e6066cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 22 Jul 2016 17:50:26 +0800 Subject: [PATCH] compositor: Pass both surface and seat in activation signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Ã…dahl Reviewed-by: Daniel Stone --- libweston/compositor.h | 5 +++++ libweston/input.c | 8 +++++++- xwayland/window-manager.c | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libweston/compositor.h b/libweston/compositor.h index 92195674..41777568 100644 --- a/libweston/compositor.h +++ b/libweston/compositor.h @@ -1011,6 +1011,11 @@ struct weston_surface_state { struct weston_buffer_viewport buffer_viewport; }; +struct weston_surface_activation_data { + struct weston_surface *surface; + struct weston_seat *seat; +}; + struct weston_surface { struct wl_resource *resource; struct wl_signal destroy_signal; /* callback argument: this surface */ diff --git a/libweston/input.c b/libweston/input.c index 9ef3949f..c733bbc0 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -2930,6 +2930,7 @@ weston_seat_set_keyboard_focus(struct weston_seat *seat, { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); + struct weston_surface_activation_data activation_data; if (keyboard && keyboard->focus != surface) { weston_keyboard_set_focus(keyboard, surface); @@ -2937,7 +2938,12 @@ weston_seat_set_keyboard_focus(struct weston_seat *seat, } inc_activate_serial(compositor); - wl_signal_emit(&compositor->activate_signal, surface); + + activation_data = (struct weston_surface_activation_data) { + .surface = surface, + .seat = seat, + }; + wl_signal_emit(&compositor->activate_signal, &activation_data); } int diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index f6f92bd5..49d974e2 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -778,7 +778,8 @@ weston_wm_send_focus_window(struct weston_wm *wm, static void weston_wm_window_activate(struct wl_listener *listener, void *data) { - struct weston_surface *surface = data; + struct weston_surface_activation_data *activation_data = data; + struct weston_surface *surface = activation_data->surface; struct weston_wm_window *window = NULL; struct weston_wm *wm = container_of(listener, struct weston_wm, activate_listener);