dnd: Remove GdkDragContext.is_source
authorBenjamin Otte <otte@redhat.com>
Fri, 15 Jun 2018 06:48:27 +0000 (08:48 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 18 Jun 2018 21:49:53 +0000 (23:49 +0200)
All drag contexts are sources these days, the other ones are GdkDrop
now.

gdk/gdkdnd.c
gdk/gdkdndprivate.h
gdk/quartz/gdkdnd-quartz.c
gdk/wayland/gdkdnd-wayland.c
gdk/win32/gdkdrag-win32.c
gdk/x11/gdkdnd-x11.c

index 60b84189fc997a18a7bb0ba964e02f00e2a2ff98..ff5819480b8096a4d1fd18ebb7597e9189f07c4c 100644 (file)
@@ -727,9 +727,6 @@ gdk_drag_context_handle_source_event (GdkEvent *event)
     {
       context = l->data;
 
-      if (!context->is_source)
-        continue;
-
       if (!GDK_DRAG_CONTEXT_GET_CLASS (context)->handle_event)
         continue;
 
index 5f1871a3be6dbe66bfa51ddb4652970ea1cc07fa..6e8bc2af8194815200ca021f0c3e490dab1ee942 100644 (file)
@@ -62,7 +62,6 @@ struct _GdkDragContext {
   GObject parent_instance;
 
   /*< private >*/
-  gboolean is_source;
   GdkSurface *source_surface;
   GdkSurface *dest_surface;
   GdkSurface *drag_surface;
index 2b80e8e32ec627b571f388bc4123698475a73bc4..4dd9cb891645dcc8489d576bbe69ea1cddec22ef 100644 (file)
@@ -46,7 +46,6 @@ _gdk_quartz_surface_drag_begin (GdkSurface *window,
   _gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
                                                   "device", device,
                                                   NULL);
-  _gdk_quartz_drag_source_context->is_source = TRUE;
 
   _gdk_quartz_drag_source_context->source_surface = window;
   g_object_ref (window);
index 98c1b7a0c987ebe476b8fb6d99335d74ab52820c..db2ac1e27d84fba1f7ec549858be210b3de853f8 100644 (file)
@@ -402,7 +402,6 @@ _gdk_wayland_surface_drag_begin (GdkSurface          *surface,
                                   NULL);
   context = GDK_DRAG_CONTEXT (context_wayland);
   context->source_surface = g_object_ref (surface);
-  context->is_source = TRUE;
 
   context_wayland->dnd_surface = create_dnd_surface (gdk_surface_get_display (surface));
   context_wayland->dnd_wl_surface = gdk_wayland_surface_get_wl_surface (context_wayland->dnd_surface);
index 31243deafcc0f5cf07814f6ed93ca1ce44dddce5..b8bdd3a515e317402de51313e4c766d2962854e7 100644 (file)
@@ -1741,7 +1741,6 @@ _gdk_win32_surface_drag_begin (GdkSurface         *window,
   drag_win32 = GDK_WIN32_DRAG_CONTEXT (drag);
 
   g_set_object (&drag->source_surface, window);
-  drag->is_source = TRUE;
 
   GDK_NOTE (DND, g_print ("_gdk_win32_surface_drag_begin\n"));
 
@@ -2551,8 +2550,6 @@ gdk_win32_drag_context_handle_event (GdkDragContext *drag,
 {
   GdkWin32DragContext *drag_win32 = GDK_WIN32_DRAG_CONTEXT (drag);
 
-  if (!drag->is_source)
-    return FALSE;
   if (!drag_win32->grab_seat)
     return FALSE;
   if (!drag_win32->handle_events)
index b21c814a57ead063822c72d4e230d3e5aef867b3..87f8610cde571040a2f8c1820451cdbc3a2e9eb9 100644 (file)
@@ -284,8 +284,7 @@ gdk_x11_drag_context_find (GdkDisplay *display,
                                   : context_x11->proxy_xid)
                             : None;
 
-      if ((context->is_source) &&
-          ((source_xid == None) || (context->source_surface &&
+      if (((source_xid == None) || (context->source_surface &&
             (GDK_SURFACE_XID (context->source_surface) == source_xid))) &&
           ((dest_xid == None) || (context_dest_xid == dest_xid)))
         return context;
@@ -2114,8 +2113,6 @@ _gdk_x11_surface_drag_begin (GdkSurface          *surface,
                                              NULL);
   x11_context = GDK_X11_DRAG_CONTEXT (context);
 
-  context->is_source = TRUE;
-
   g_signal_connect (display, "xevent", G_CALLBACK (gdk_x11_drag_context_xevent), context);
 
   precache_target_list (context);
@@ -2433,8 +2430,6 @@ gdk_x11_drag_context_handle_event (GdkDragContext *context,
 {
   GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context);
 
-  if (!context->is_source)
-    return FALSE;
   if (!x11_context->grab_seat)
     return FALSE;