From ed012ee5051ad7063a48c0b51d8b44eea52a129c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez?= Date: Wed, 29 Mar 2023 10:33:30 -0500 Subject: [PATCH] libweston: Store view instead of surface, and add flags, to activation data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we want to pass the view to the surface activation listener inside the constraints code, and the surface is reachable from the view anyway. The flags field will let us pass the reason for activation to the constraints code, which will then handle especially the fullscreen case. Signed-off-by: Sergio Gómez --- include/libweston/libweston.h | 3 ++- libweston/input.c | 5 +++-- xwayland/window-manager.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 81873027..2f454712 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1772,8 +1772,9 @@ struct weston_surface_state { }; struct weston_surface_activation_data { - struct weston_surface *surface; + struct weston_view *view; struct weston_seat *seat; + uint32_t flags; }; struct weston_pointer_constraint { diff --git a/libweston/input.c b/libweston/input.c index 0b0c2bf7..610d481c 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -2354,8 +2354,9 @@ weston_view_activate_input(struct weston_view *view, inc_activate_serial(compositor); activation_data = (struct weston_surface_activation_data) { - .surface = view->surface, + .view = view, .seat = seat, + .flags = flags }; wl_signal_emit(&compositor->activate_signal, &activation_data); } @@ -4823,7 +4824,7 @@ pointer_constraint_surface_activate(struct wl_listener *listener, void *data) { struct weston_surface_activation_data *activation = data; struct weston_pointer *pointer; - struct weston_surface *focus = activation->surface; + struct weston_surface *focus = activation->view->surface; struct weston_pointer_constraint *constraint = container_of(listener, struct weston_pointer_constraint, surface_activate_listener); diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 378c0123..63e3e239 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -984,7 +984,7 @@ static void weston_wm_window_activate(struct wl_listener *listener, void *data) { struct weston_surface_activation_data *activation_data = data; - struct weston_surface *surface = activation_data->surface; + struct weston_surface *surface = activation_data->view->surface; struct weston_wm_window *window = NULL; struct weston_wm *wm = container_of(listener, struct weston_wm, activate_listener);