core: Pass device/sequence on meta_window_begin_grab_op()

This is a public API change. Add device/sequence parameters to this
operation, so that window dragging and resizing can stick to one
set of pointing events of them all.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
This commit is contained in:
Carlos Garnacho
2022-10-21 19:52:35 +02:00
committed by Marge Bot
parent 18535928e7
commit d687e5634d
11 changed files with 114 additions and 45 deletions

View File

@ -1543,11 +1543,13 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
}
gboolean
meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
MetaWaylandSeat *seat,
MetaGrabOp grab_op,
gfloat x,
gfloat y)
meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
MetaWaylandSeat *seat,
MetaGrabOp grab_op,
ClutterInputDevice *device,
ClutterEventSequence *sequence,
gfloat x,
gfloat y)
{
MetaWindow *window = meta_wayland_surface_get_window (surface);
@ -1559,6 +1561,7 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
being moved/resized via a SSD event. */
return meta_window_begin_grab_op (window,
grab_op,
device, sequence,
meta_display_get_current_time_roundtrip (window->display));
}

View File

@ -341,11 +341,13 @@ MetaWaylandSurface * meta_wayland_surface_role_get_surface (MetaWaylandSurfaceRo
cairo_region_t * meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface);
gboolean meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
MetaWaylandSeat *seat,
MetaGrabOp grab_op,
gfloat x,
gfloat y);
gboolean meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
MetaWaylandSeat *seat,
MetaGrabOp grab_op,
ClutterInputDevice *device,
ClutterEventSequence *sequence,
gfloat x,
gfloat y);
void meta_wayland_surface_window_managed (MetaWaylandSurface *surface,
MetaWindow *window);

View File

@ -318,6 +318,8 @@ xdg_toplevel_move (struct wl_client *client,
MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
MetaWaylandSurface *surface = surface_from_xdg_toplevel_resource (resource);
MetaWindow *window;
ClutterInputDevice *device;
ClutterEventSequence *sequence;
float x, y;
window = meta_wayland_surface_get_window (surface);
@ -325,10 +327,11 @@ xdg_toplevel_move (struct wl_client *client,
return;
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE,
NULL, NULL, &x, &y))
&device, &sequence, &x, &y))
return;
meta_wayland_surface_begin_grab_op (surface, seat, META_GRAB_OP_MOVING, x, y);
meta_wayland_surface_begin_grab_op (surface, seat, META_GRAB_OP_MOVING,
device, sequence, x, y);
}
static MetaGrabOp
@ -366,6 +369,8 @@ xdg_toplevel_resize (struct wl_client *client,
MetaWindow *window;
gfloat x, y;
MetaGrabOp grab_op;
ClutterInputDevice *device;
ClutterEventSequence *sequence;
window = meta_wayland_surface_get_window (surface);
if (!window)
@ -375,11 +380,12 @@ xdg_toplevel_resize (struct wl_client *client,
return;
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE,
NULL, NULL, &x, &y))
&device, &sequence, &x, &y))
return;
grab_op = grab_op_for_xdg_toplevel_resize_edge (edges);
meta_wayland_surface_begin_grab_op (surface, seat, grab_op, x, y);
meta_wayland_surface_begin_grab_op (surface, seat, grab_op,
device, sequence, x, y);
}
static void