[gtk+] GtkDnd: Move X11-specific code out of generic code path
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkDnd: Move X11-specific code out of generic code path
- Date: Sat, 13 Sep 2014 02:31:55 +0000 (UTC)
commit 45369d506bae2880379aa2866f6bcc0bc8f6d38d
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 12 22:12:26 2014 -0400
GtkDnd: Move X11-specific code out of generic code path
There was some X11-specific code before an early exit
in the functions that grab and ungrab keys during DND.
It seems to not cause a problem under Wayland, but moving
it out of the way seems right anyway.
gtk/gtkdnd.c | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 16ea22e..b662e6d 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -468,14 +468,6 @@ grab_dnd_keys (GtkWidget *widget,
unsigned char mask[(XI_LASTEVENT + 7)/8];
gboolean using_xi2;
- deviceid = gdk_x11_device_get_id (device);
-
- if (GDK_IS_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (gtk_widget_get_display (widget))))
- using_xi2 = TRUE;
- else
- using_xi2 = FALSE;
-#endif
-
window = gtk_widget_get_window (widget);
if (!GDK_IS_X11_WINDOW (window))
{
@@ -487,6 +479,13 @@ grab_dnd_keys (GtkWidget *widget,
return;
}
+ deviceid = gdk_x11_device_get_id (device);
+
+ if (GDK_IS_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (gtk_widget_get_display (widget))))
+ using_xi2 = TRUE;
+ else
+ using_xi2 = FALSE;
+#endif
root = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
@@ -553,13 +552,6 @@ ungrab_dnd_keys (GtkWidget *widget,
gint deviceid;
gboolean using_xi2;
- deviceid = gdk_x11_device_get_id (device);
- if (GDK_IS_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (gtk_widget_get_display (widget))))
- using_xi2 = TRUE;
- else
- using_xi2 = FALSE;
-#endif
-
window = gtk_widget_get_window (widget);
if (!GDK_IS_X11_WINDOW (window))
{
@@ -567,6 +559,14 @@ ungrab_dnd_keys (GtkWidget *widget,
return;
}
+ deviceid = gdk_x11_device_get_id (device);
+
+ if (GDK_IS_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (gtk_widget_get_display (widget))))
+ using_xi2 = TRUE;
+ else
+ using_xi2 = FALSE;
+#endif
+
root = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
gdk_window_remove_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
@@ -627,7 +627,6 @@ ungrab_dnd_keys (GtkWidget *widget,
#endif /* GDK_WINDOWING_X11 */
-
/*
* gtk_drag_release_ipc_widget:
* @widget: the widget to release
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]