libweston: Store view instead of surface, and add flags, to activation data

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 <sergio.g.delreal@gmail.com>
This commit is contained in:
Sergio Gómez 2023-03-29 10:33:30 -05:00 committed by Marius Vlad
parent d11732c0fd
commit ed012ee505
3 changed files with 6 additions and 4 deletions

View File

@ -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 {

View File

@ -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);

View File

@ -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);