diff options
author | Wolfgang Ulbrich <[email protected]> | 2016-01-15 23:26:05 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2016-01-15 23:26:05 +0100 |
commit | 3c796cdf6020ac59cbcaca103453501292423c71 (patch) | |
tree | 1cb80a4771c7df62438a7d77f68ce9cfed8284b3 /eel | |
parent | 50970d1bb15d1f9c682e92dda345e59cfcf5330f (diff) | |
download | caja-3c796cdf6020ac59cbcaca103453501292423c71.tar.bz2 caja-3c796cdf6020ac59cbcaca103453501292423c71.tar.xz |
GTK3 all: don't use deprecated GDK pointer methods
Use the new GdkDevice methods instead.
taken from:
https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-4&id=a816e00
https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-4&id=cdf858f
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-art-gtk-extensions.c | 13 | ||||
-rw-r--r-- | eel/eel-editable-label.c | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/eel/eel-art-gtk-extensions.c b/eel/eel-art-gtk-extensions.c index f7009991..5e7f4dab 100644 --- a/eel/eel-art-gtk-extensions.c +++ b/eel/eel-art-gtk-extensions.c @@ -327,11 +327,24 @@ eel_gdk_get_pointer_position (void) { EelIPoint position; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkDeviceManager *manager; + GdkDevice *pointer; + + manager = gdk_display_get_device_manager (gdk_window_get_display (gdk_get_default_root_window ())); + pointer = gdk_device_manager_get_client_pointer (manager); + gdk_window_get_device_position (gdk_get_default_root_window (), + pointer, + &position.x, + &position.y, + NULL); +#else gdk_window_get_pointer (gdk_get_default_root_window (), &position.x, &position.y, NULL); +#endif return position; } diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c index 21dfd673..6f66c120 100644 --- a/eel/eel-editable-label.c +++ b/eel/eel-editable-label.c @@ -2162,8 +2162,14 @@ eel_editable_label_motion (GtkWidget *widget, if ((event->state & GDK_BUTTON1_MASK) == 0) return FALSE; +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_window_get_device_position (gtk_widget_get_window (widget), + event->device, + &x, &y, NULL); +#else gdk_window_get_pointer (gtk_widget_get_window (widget), &x, &y, NULL); +#endif get_layout_index (label, x, y, &index); |