summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2015-09-01 21:54:27 +0200
committerinfirit <[email protected]>2015-09-06 13:08:31 +0200
commita4ef374026fb32517922e3977ea4b9d7d1a0b621 (patch)
treeb027534d356b06f7c825635ff64d46c28b50d188 /src
parent97aea5c0ad0a57ee111a81f69a89f81bf1d0bbe3 (diff)
downloadeom-a4ef374026fb32517922e3977ea4b9d7d1a0b621.tar.bz2
eom-a4ef374026fb32517922e3977ea4b9d7d1a0b621.tar.xz
Gtk3: Fix GDK deprecations
- deprecated gdk_window_get_pointer taken from: https://git.gnome.org/browse/eog/commit/?id=c87818d
Diffstat (limited to 'src')
-rw-r--r--src/eom-scroll-view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index d939d35..66de49a 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -1505,9 +1505,20 @@ display_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data)
}
if (do_zoom) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDeviceManager *device_manager;
+ GdkDevice *device;
+#endif
gint x, y;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ device_manager = gdk_display_get_device_manager (gtk_widget_get_display(widget));
+ device = gdk_device_manager_get_client_pointer (device_manager);
+
+ gdk_window_get_device_position (gtk_widget_get_window (widget), device,
+#else
gdk_window_get_pointer (gtk_widget_get_window (widget),
+#endif
&x, &y, NULL);
set_zoom (view, zoom, TRUE, x, y);
}
@@ -1691,7 +1702,11 @@ eom_scroll_view_motion_event (GtkWidget *widget, GdkEventMotion *event, gpointer
return FALSE;
if (event->is_hint)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (priv->display)), event->device, &x, &y, &mods);
+#else
gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (priv->display)), &x, &y, &mods);
+#endif
else {
x = event->x;
y = event->y;