diff options
author | raveit65 <[email protected]> | 2016-06-26 21:18:38 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-07-04 14:40:52 +0200 |
commit | e8faf61c1af5de5e7a5292d4e637236800c97842 (patch) | |
tree | 015ce3700f56ca83eb75de90c5bc1fba0b08bcf9 /libcaja-private | |
parent | 461fab0bb7432a222577f74f5807fc830c192ba8 (diff) | |
download | caja-e8faf61c1af5de5e7a5292d4e637236800c97842.tar.bz2 caja-e8faf61c1af5de5e7a5292d4e637236800c97842.tar.xz |
GTK+-3.20 caja-dnd: use GdkSeat operations
Some GdkDisplay operations have been deprecated in GDK 3.20.
This commit replaces the deprecated code with new GdkSeat
operations.
https://bugzilla.gnome.org/show_bug.cgi?id=762235
taken from:
https://git.gnome.org/browse/nautilus/commit/?id=98dce7d
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-dnd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libcaja-private/caja-dnd.c b/libcaja-private/caja-dnd.c index f1e3bb70..af4c44e9 100644 --- a/libcaja-private/caja-dnd.c +++ b/libcaja-private/caja-dnd.c @@ -957,7 +957,11 @@ void caja_drag_autoscroll_calculate_delta (GtkWidget *widget, float *x_scroll_delta, float *y_scroll_delta) { GtkAllocation allocation; -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION (3, 20, 0) + GdkDisplay *display; + GdkSeat *seat; + GdkDevice *pointer; +#elif GTK_CHECK_VERSION (3, 0, 0) GdkDeviceManager *manager; GdkDevice *pointer; #endif @@ -965,7 +969,13 @@ caja_drag_autoscroll_calculate_delta (GtkWidget *widget, float *x_scroll_delta, g_assert (GTK_IS_WIDGET (widget)); -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION (3, 20, 0) + display = gtk_widget_get_display (widget); + seat = gdk_display_get_default_seat (display); + pointer = gdk_seat_get_pointer (seat); + gdk_window_get_device_position (gtk_widget_get_window (widget), pointer, + &x, &y, NULL); +#elif GTK_CHECK_VERSION (3, 0, 0) manager = gdk_display_get_device_manager (gtk_widget_get_display (widget)); pointer = gdk_device_manager_get_client_pointer (manager); gdk_window_get_device_position (gtk_widget_get_window (widget), pointer, |