summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-05-30 17:14:13 +0200
committerraveit65 <[email protected]>2016-05-30 17:14:13 +0200
commite07af0d9049af36e1670a12deff39ea09616b6cd (patch)
treec8be2fb80f2509c25de9060029041935b18e7cb3
parentc816ebb3cdcca4559bcc25356bd5287dfaae982e (diff)
downloadmate-utils-e07af0d9049af36e1670a12deff39ea09616b6cd.tar.bz2
mate-utils-e07af0d9049af36e1670a12deff39ea09616b6cd.tar.xz
GTK+3 mdict defbox: do not use deprecated gdk_window_get_pointer
taken from: https://git.gnome.org/browse/gnome-dictionary/commit/?id=8be0a24
-rw-r--r--mate-dictionary/libgdict/gdict-defbox.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c
index c71c6921..9dfb1aa7 100644
--- a/mate-dictionary/libgdict/gdict-defbox.c
+++ b/mate-dictionary/libgdict/gdict-defbox.c
@@ -1610,7 +1610,9 @@ defbox_motion_notify_cb (GtkWidget *text_view,
set_cursor_if_appropriate (defbox, GTK_TEXT_VIEW (text_view), bx, by);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
+#endif
return FALSE;
}
@@ -1620,10 +1622,22 @@ defbox_visibility_notify_cb (GtkWidget *text_view,
GdkEventVisibility *event,
GdictDefbox *defbox)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDisplay *display;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
+#endif
gint wx, wy;
gint bx, by;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ display = gdk_window_get_display (event->window);
+ device_manager = gdk_display_get_device_manager (display);
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_window_get_device_position (gtk_widget_get_window (text_view), pointer, &wx, &wy, NULL);
+#else
gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+#endif
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,