[gtk+/wayland-selections: 15/15] gtkdnd: Harcode the DnD window onto the drag widget window on Wayland



commit 590be692a903ce76552a49d0290b1a9ba215ac4d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 28 14:44:44 2014 +0200

    gtkdnd: Harcode the DnD window onto the drag widget window on Wayland
    
    This makes the drag widget use the same window surface that was passed
    when starting the drag operation.

 gtk/gtkdnd.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index cc59591..6fabf68 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -39,6 +39,10 @@
 #endif
 #endif
 
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/wayland/gdkwayland.h>
+#endif
+
 #include "gtkdnd.h"
 #include "gtkiconhelperprivate.h"
 #include "gtkicontheme.h"
@@ -49,6 +53,7 @@
 #include "gtkwindow.h"
 #include "gtkintl.h"
 #include "gtkselectionprivate.h"
+#include "gtkwindowprivate.h"
 
 
 /**
@@ -3293,6 +3298,12 @@ set_icon_helper (GdkDragContext *context,
                              gtk_widget_get_style_context (window),
                              &width, &height);
 
+#ifdef GDK_WINDOWING_WAYLAND
+  if (GDK_IS_WAYLAND_DISPLAY (display))
+    gtk_window_set_hardcoded_window (GTK_WINDOW (window),
+                                     gdk_wayland_drag_context_get_dnd_window (context));
+#endif
+
   if (!force_window &&
       gtk_drag_can_use_rgba_cursor (display, width + 2, height + 2))
     {
@@ -3463,6 +3474,12 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
   gtk_window_set_screen (GTK_WINDOW (window), screen);
   set_can_change_screen (window, TRUE);
 
+#ifdef GDK_WINDOWING_WAYLAND
+  if (GDK_IS_WAYLAND_DISPLAY (gdk_screen_get_display (screen)))
+    gtk_window_set_hardcoded_window (GTK_WINDOW (window),
+                                     gdk_wayland_drag_context_get_dnd_window (context));
+#endif
+
   gtk_widget_set_events (window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
   gtk_widget_set_app_paintable (window, TRUE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]