summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-08-01 15:46:11 +0200
committerraveit65 <[email protected]>2017-08-15 10:52:56 +0200
commit3b04abf8487f6f61fc991ea365ce79cc88778ae6 (patch)
treed28c4ac75b7a35676a0d67c5aa7036030fdac958
parent63caea788b0922fa0bbcd3ec6b0e34a6ba0b3c9b (diff)
downloadmate-control-center-3b04abf8487f6f61fc991ea365ce79cc88778ae6.tar.bz2
mate-control-center-3b04abf8487f6f61fc991ea365ce79cc88778ae6.tar.xz
display scrollarea: avoid deprecated gdk_window_get_pointer
-rw-r--r--capplets/display/scrollarea.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/capplets/display/scrollarea.c b/capplets/display/scrollarea.c
index b475fda2..b3302a75 100644
--- a/capplets/display/scrollarea.c
+++ b/capplets/display/scrollarea.c
@@ -526,6 +526,14 @@ emit_viewport_changed (FooScrollArea *scroll_area,
GdkRectangle *new_viewport,
GdkRectangle *old_viewport)
{
+#if GTK_CHECK_VERSION (3, 20, 0)
+ GdkDisplay *display;
+ GdkSeat *seat;
+#else
+ GdkDeviceManager *manager;
+#endif
+ GdkDevice *pointer;
+
int px, py;
g_signal_emit (scroll_area, signals[VIEWPORT_CHANGED], 0,
new_viewport, old_viewport);
@@ -533,7 +541,19 @@ emit_viewport_changed (FooScrollArea *scroll_area,
if (scroll_area->priv->input_window == NULL)
return;
- gdk_window_get_pointer (scroll_area->priv->input_window, &px, &py, NULL);
+#if GTK_CHECK_VERSION (3, 20, 0)
+ display = gdk_window_get_display (scroll_area->priv->input_window);
+ seat = gdk_display_get_default_seat (display);
+ pointer = gdk_seat_get_pointer (seat);
+#else
+ manager = gdk_display_get_device_manager (gdk_window_get_display (scroll_area->priv->input_window));
+ pointer = gdk_device_manager_get_client_pointer (manager);
+#endif
+ gdk_window_get_device_position (scroll_area->priv->input_window,
+ pointer,
+ &px,
+ &py,
+ NULL);
process_event (scroll_area, FOO_MOTION, px, py);
}