[gtk/wip/chergert/gdk-macos-gdkdrag: 3/8] macos: move drag motion to GdkMacosDrag
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-gdkdrag: 3/8] macos: move drag motion to GdkMacosDrag
- Date: Sat, 19 Jun 2021 02:29:04 +0000 (UTC)
commit b8ae8ccf6361ebb47fe87ff9ff510442e65eb4f8
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 17 13:24:39 2021 -0700
macos: move drag motion to GdkMacosDrag
This doesn't help to be pushed off into the surface, as it makes things
more different than the X11 implementation.
gdk/macos/gdkmacosdrag.c | 12 ++++++------
gdk/macos/gdkmacosdragsurface-private.h | 20 +++++++-------------
gdk/macos/gdkmacosdragsurface.c | 13 -------------
3 files changed, 13 insertions(+), 32 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdrag.c b/gdk/macos/gdkmacosdrag.c
index c89b01948f..ee4b5e7020 100644
--- a/gdk/macos/gdkmacosdrag.c
+++ b/gdk/macos/gdkmacosdrag.c
@@ -326,12 +326,10 @@ gdk_drag_update (GdkDrag *drag,
&suggested_action,
&possible_actions);
- _gdk_macos_drag_surface_drag_motion (self->drag_surface,
- x_root - self->hot_x,
- y_root - self->hot_y,
- suggested_action,
- possible_actions,
- evtime);
+ if (GDK_IS_MACOS_SURFACE (self->drag_surface))
+ _gdk_macos_surface_move (GDK_MACOS_SURFACE (self->drag_surface),
+ x_root - self->hot_x,
+ y_root - self->hot_y);
if (!self->did_update)
{
@@ -339,6 +337,8 @@ gdk_drag_update (GdkDrag *drag,
self->start_y = self->last_y;
self->did_update = TRUE;
}
+
+ gdk_drag_set_actions (drag, possible_actions);
}
static gboolean
diff --git a/gdk/macos/gdkmacosdragsurface-private.h b/gdk/macos/gdkmacosdragsurface-private.h
index cf7408f308..bc84e3d30f 100644
--- a/gdk/macos/gdkmacosdragsurface-private.h
+++ b/gdk/macos/gdkmacosdragsurface-private.h
@@ -31,19 +31,13 @@ typedef struct _GdkMacosDragSurfaceClass GdkMacosDragSurfaceClass;
#define GDK_MACOS_DRAG_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object),
GDK_TYPE_MACOS_DRAG_SURFACE, GdkMacosDragSurface))
#define GDK_IS_MACOS_DRAG_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object),
GDK_TYPE_MACOS_DRAG_SURFACE))
-GType _gdk_macos_drag_surface_get_type (void);
-GdkMacosSurface *_gdk_macos_drag_surface_new (GdkMacosDisplay *display,
- GdkFrameClock *frame_clock,
- int x,
- int y,
- int width,
- int height);
-void _gdk_macos_drag_surface_drag_motion (GdkMacosDragSurface *self,
- int x_root,
- int y_root,
- GdkDragAction suggested_action,
- GdkDragAction possible_actions,
- guint32 evtime);
+GType _gdk_macos_drag_surface_get_type (void);
+GdkMacosSurface *_gdk_macos_drag_surface_new (GdkMacosDisplay *display,
+ GdkFrameClock *frame_clock,
+ int x,
+ int y,
+ int width,
+ int height);
G_END_DECLS
diff --git a/gdk/macos/gdkmacosdragsurface.c b/gdk/macos/gdkmacosdragsurface.c
index 2b03583604..dd6d5e520e 100644
--- a/gdk/macos/gdkmacosdragsurface.c
+++ b/gdk/macos/gdkmacosdragsurface.c
@@ -123,16 +123,3 @@ _gdk_macos_drag_surface_new (GdkMacosDisplay *display,
return g_steal_pointer (&self);
}
-
-void
-_gdk_macos_drag_surface_drag_motion (GdkMacosDragSurface *self,
- int x_root,
- int y_root,
- GdkDragAction suggested_action,
- GdkDragAction possible_actions,
- guint32 evtime)
-{
- g_return_if_fail (GDK_IS_MACOS_DRAG_SURFACE (self));
-
- _gdk_macos_surface_move (GDK_MACOS_SURFACE (self), x_root, y_root);
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]