Commit c8493234 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte
Browse files

GladeUtils: fix glade_utils_get_pointer()

Use default pointer device instead of device from current event
since a paste can be triggered by the keyboard.

This fix issue pasing widget with ctrl+v in GtkGrid
parent 29d16f4b
Pipeline #216403 passed with stages
in 5 minutes and 43 seconds
......@@ -1165,15 +1165,15 @@ glade_util_search_devhelp (const gchar *book,
GtkWidget *
glade_util_get_placeholder_from_pointer (GtkContainer *container)
{
GdkDeviceManager *manager;
GdkDisplay *display;
GdkDevice *device;
GdkWindow *window;
GdkSeat *seat;
if (((display = gtk_widget_get_display (GTK_WIDGET (container))) ||
(display = gdk_display_get_default ())) &&
(manager = gdk_display_get_device_manager (display)) &&
(device = gdk_device_manager_get_client_pointer (manager)) &&
(seat = gdk_display_get_default_seat (display)) &&
(device = gdk_seat_get_pointer (seat)) &&
(window = gdk_device_get_window_at_position (device, NULL, NULL)))
{
gpointer widget;
......@@ -2069,10 +2069,14 @@ glade_utils_get_pointer (GtkWidget *widget,
if (!device)
{
GdkEvent *event = gtk_get_current_event ();
device = gdk_event_get_device (event);
gdk_event_free (event);
GdkDisplay *dsp;
GdkSeat *seat;
if (((dsp = gtk_widget_get_display (widget)) ||
(dsp = gdk_display_get_default ())) &&
(seat = gdk_display_get_default_seat (dsp)) &&
(device = gdk_seat_get_pointer (seat)))
window = gdk_device_get_window_at_position (device, NULL, NULL);
}
g_return_if_fail (GDK_IS_DEVICE (device));
......
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