core: Pass position hint to meta_window_begin_grab_op()

Add an argument to pass the position hint to this public API
call, so that callers can specify such hint. Everyone passes
NULL at the moment.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3546>
This commit is contained in:
Carlos Garnacho 2024-01-25 16:41:38 +01:00
parent 51e084ee8d
commit 4b1e24fcc4
5 changed files with 20 additions and 10 deletions

View File

@ -2683,7 +2683,8 @@ handle_begin_move (MetaDisplay *display,
META_GRAB_OP_KEYBOARD_MOVING | META_GRAB_OP_KEYBOARD_MOVING |
META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED,
device, NULL, device, NULL,
clutter_event_get_time ((ClutterEvent *) event)); clutter_event_get_time ((ClutterEvent *) event),
NULL);
} }
} }
@ -2707,7 +2708,8 @@ handle_begin_resize (MetaDisplay *display,
META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN | META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN |
META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED,
device, NULL, device, NULL,
clutter_event_get_time ((ClutterEvent *) event)); clutter_event_get_time ((ClutterEvent *) event),
NULL);
} }
} }

View File

@ -6076,19 +6076,21 @@ meta_window_is_ancestor_of_transient (MetaWindow *window,
* @device: (nullable): * @device: (nullable):
* @sequence: (nullable): * @sequence: (nullable):
* @timestamp: * @timestamp:
* @pos_hint: (nullable):
**/ **/
gboolean gboolean
meta_window_begin_grab_op (MetaWindow *window, meta_window_begin_grab_op (MetaWindow *window,
MetaGrabOp op, MetaGrabOp op,
ClutterInputDevice *device, ClutterInputDevice *device,
ClutterEventSequence *sequence, ClutterEventSequence *sequence,
guint32 timestamp) guint32 timestamp,
graphene_point_t *pos_hint)
{ {
return meta_compositor_drag_window (window->display->compositor, return meta_compositor_drag_window (window->display->compositor,
window, op, window, op,
device, sequence, device, sequence,
timestamp, timestamp,
NULL); pos_hint);
} }
MetaStackLayer MetaStackLayer
@ -7456,7 +7458,8 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
op, op,
clutter_event_get_device (event), clutter_event_get_device (event),
clutter_event_get_event_sequence (event), clutter_event_get_event_sequence (event),
time_ms); time_ms,
NULL);
} }
} }
} }
@ -7477,7 +7480,8 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED,
clutter_event_get_device (event), clutter_event_get_device (event),
clutter_event_get_event_sequence (event), clutter_event_get_event_sequence (event),
time_ms); time_ms,
NULL);
} }
} }
} }

View File

@ -399,7 +399,8 @@ gboolean meta_window_begin_grab_op (MetaWindow *window,
MetaGrabOp op, MetaGrabOp op,
ClutterInputDevice *device, ClutterInputDevice *device,
ClutterEventSequence *sequence, ClutterEventSequence *sequence,
guint32 timestamp); guint32 timestamp,
graphene_point_t *pos_hint);
META_EXPORT META_EXPORT
gboolean meta_window_can_maximize (MetaWindow *window); gboolean meta_window_can_maximize (MetaWindow *window);

View File

@ -1615,7 +1615,8 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
return meta_window_begin_grab_op (window, return meta_window_begin_grab_op (window,
grab_op, grab_op,
device, sequence, device, sequence,
meta_display_get_current_time_roundtrip (window->display)); meta_display_get_current_time_roundtrip (window->display),
NULL);
} }
/** /**

View File

@ -3406,7 +3406,8 @@ meta_window_x11_client_message (MetaWindow *window,
meta_window_begin_grab_op (window, op, meta_window_begin_grab_op (window, op,
clutter_seat_get_pointer (seat), clutter_seat_get_pointer (seat),
NULL, NULL,
timestamp); timestamp,
NULL);
} }
else if (op != META_GRAB_OP_NONE && else if (op != META_GRAB_OP_NONE &&
((window->has_move_func && op == META_GRAB_OP_MOVING) || ((window->has_move_func && op == META_GRAB_OP_MOVING) ||
@ -3441,7 +3442,8 @@ meta_window_x11_client_message (MetaWindow *window,
meta_window_begin_grab_op (window, op, meta_window_begin_grab_op (window, op,
device, device,
sequence, sequence,
timestamp); timestamp,
NULL);
window_drag = window_drag =
meta_compositor_get_current_window_drag (window->display->compositor); meta_compositor_get_current_window_drag (window->display->compositor);