From 51e084ee8d5fe2a5842a01104904ceafe83f8500 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 25 Jan 2024 16:39:11 +0100 Subject: [PATCH] compositor: Forward window drag position hint across internals Allow passing an argument to meta_compositor_drag_window() to pass the hint. Unused so far. Part-of: --- src/compositor/compositor-private.h | 5 ++++- src/compositor/compositor.c | 6 +++++- src/core/window.c | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h index 5bf95ee73..e9b11f1b4 100644 --- a/src/compositor/compositor-private.h +++ b/src/compositor/compositor-private.h @@ -2,6 +2,8 @@ #pragma once +#include + #include "clutter/clutter-mutter.h" #include "clutter/clutter.h" #include "compositor/meta-compositor-view.h" @@ -76,7 +78,8 @@ gboolean meta_compositor_drag_window (MetaCompositor *compositor, MetaGrabOp grab_op, ClutterInputDevice *device, ClutterEventSequence *sequence, - uint32_t timestamp); + uint32_t timestamp, + graphene_point_t *pos_hint); MetaWindowDrag * meta_compositor_get_current_window_drag (MetaCompositor *compositor); diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 017ea9d56..7fb104763 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1571,7 +1571,8 @@ meta_compositor_drag_window (MetaCompositor *compositor, MetaGrabOp grab_op, ClutterInputDevice *device, ClutterEventSequence *sequence, - uint32_t timestamp) + uint32_t timestamp, + graphene_point_t *pos_hint) { MetaCompositorPrivate *priv = meta_compositor_get_instance_private (compositor); @@ -1582,6 +1583,9 @@ meta_compositor_drag_window (MetaCompositor *compositor, window_drag = meta_window_drag_new (window, grab_op); + if (pos_hint) + meta_window_drag_set_position_hint (window_drag, pos_hint); + if (!meta_window_drag_begin (window_drag, device, sequence, timestamp)) return FALSE; diff --git a/src/core/window.c b/src/core/window.c index e0c5f8dd5..812e59dda 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6087,7 +6087,8 @@ meta_window_begin_grab_op (MetaWindow *window, return meta_compositor_drag_window (window->display->compositor, window, op, device, sequence, - timestamp); + timestamp, + NULL); } MetaStackLayer