[gtk+/xi2] DnD: Use GTK+ device grabs.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/xi2] DnD: Use GTK+ device grabs.
- Date: Tue, 9 Mar 2010 17:54:33 +0000 (UTC)
commit f07e1508b4ad65e8e5aa5feab66bd084f86f8541
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Mar 9 18:31:33 2010 +0100
DnD: Use GTK+ device grabs.
gtk/gtkdnd.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index caa49a7..a14a243 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -2452,8 +2452,8 @@ gtk_drag_begin_internal (GtkWidget *widget,
/* We use a GTK grab here to override any grabs that the widget
* we are dragging from might have held
*/
- gtk_grab_add (ipc_widget);
-
+ gtk_device_grab_add (ipc_widget, pointer, FALSE);
+
tmp_list = g_list_last (target_list->list);
while (tmp_list)
{
@@ -4195,7 +4195,7 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
gdk_device_ungrab (pointer, time);
ungrab_dnd_keys (info->ipc_widget, keyboard, time);
- gtk_grab_remove (info->ipc_widget);
+ gtk_device_grab_remove (info->ipc_widget, pointer);
/* Send on a release pair to the original
* widget to convince it to release its grab. We need to
@@ -4389,8 +4389,11 @@ gtk_drag_grab_notify_cb (GtkWidget *widget,
gpointer data)
{
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
+ GdkDevice *pointer;
+
+ pointer = gdk_drag_context_get_device (info->context);
- if (!was_grabbed)
+ if (gtk_widget_device_is_shadowed (widget, pointer))
{
/* We have to block callbacks to avoid recursion here, because
gtk_drag_cancel calls gtk_grab_remove (via gtk_drag_end) */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]