summaryrefslogtreecommitdiff
path: root/patches/GdkQuartzWindow.patch
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-07-20 16:55:51 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-07-20 16:56:15 -0400
commitcdedf7f617e76b024c384e6d842487e6d8f67f46 (patch)
tree0295757af2120c41f1eab32f3cc3d19ead2b2b51 /patches/GdkQuartzWindow.patch
parent7198908a00fa87b329035c6beebb81cfde719e41 (diff)
patches to fix notebook tab tearoff on DnD.
See also https://bugzilla.gnome.org/show_bug.cgi?id=752638 for updates on integration into GTK+ 2 and GTK+ 3
Diffstat (limited to 'patches/GdkQuartzWindow.patch')
-rw-r--r--patches/GdkQuartzWindow.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/patches/GdkQuartzWindow.patch b/patches/GdkQuartzWindow.patch
new file mode 100644
index 0000000000..217c010ffb
--- /dev/null
+++ b/patches/GdkQuartzWindow.patch
@@ -0,0 +1,44 @@
+--- old/gtk+-2.24.23/gdk/quartz/GdkQuartzWindow.c 2013-10-16 11:29:55.000000000 -0400
++++ new/gtk+-2.24.23/gdk/quartz/GdkQuartzWindow.c 2015-07-20 15:05:40.000000000 -0400
+@@ -625,6 +625,41 @@
+ event.dnd.send_event = FALSE;
+ event.dnd.context = _gdk_quartz_drag_source_context;
+
++ /* Check to see if the coordinates are inside a known GdkWindow */
++
++ GdkScreen* screen = gdk_window_get_screen (event.dnd.window);
++
++ if (screen)
++ {
++ GList* windows, *list;
++ gint gx, gy;
++
++ event.dnd.context->dest_window = NULL;
++
++ windows = gdk_screen_get_toplevel_windows (screen);
++ _gdk_quartz_window_nspoint_to_gdk_xy (aPoint, &gx, &gy);
++
++ for (list = windows; list; list = list->next)
++ {
++ GdkWindow* win = (GdkWindow*) list->data;
++ gint wx, wy;
++ gint ww, wh;
++
++ gdk_window_get_root_origin (win, &wx, &wy);
++ ww = gdk_window_get_width (win);
++ wh = gdk_window_get_height (win);
++
++ if (gx > wx &&
++ gy > wy &&
++ gx <= wx + ww &&
++ gy <= wy + wh)
++ {
++ /* found a toplevel GdkWindow at the drop position */
++ event.dnd.context->dest_window = win;
++ }
++ }
++ }
++
+ (*_gdk_event_func) (&event, _gdk_event_data);
+
+ g_object_unref (event.dnd.window);