Commit 45369d50 authored by Matthias Clasen's avatar Matthias Clasen

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.
parent ca27bf37
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment