[glade/glade-3-38] GladeUtils: fix glade_utils_get_pointer()
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/glade-3-38] GladeUtils: fix glade_utils_get_pointer()
- Date: Fri, 2 Oct 2020 19:30:16 +0000 (UTC)
commit 4cd9fa17167e750558ab6fdfb28fc1e61ab21585
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Fri Sep 25 16:28:04 2020 -0300
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
gladeui/glade-utils.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index 904e3ebb..6757c594 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]