summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-07-29 21:13:15 +0200
committerraveit65 <[email protected]>2016-08-31 16:14:15 +0200
commitae9e1b41e01db427feb699f14efe9f8886432d51 (patch)
tree15b0e61576a18a1ddbac57f21ae96173a37062f3
parent56bd0058b6c19b7c13574d548f6d6dbdbe81448b (diff)
downloadpluma-ae9e1b41e01db427feb699f14efe9f8886432d51.tar.bz2
pluma-ae9e1b41e01db427feb699f14efe9f8886432d51.tar.xz
GTK+-3 pluma-window: use gdk_device_get_position
taken from: https://git.gnome.org/browse/gedit/commit/?id=66ce4ca https://git.gnome.org/browse/gedit/commit/?id=c48ab83
-rw-r--r--pluma/pluma-window.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index 7e18211c..15bba5e0 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -2915,6 +2915,16 @@ on_fullscreen_controls_leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event,
PlumaWindow *window)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDevice *device;
+ gint w, h;
+ gint x, y;
+
+ device = gdk_event_get_device ((GdkEvent *)event);
+
+ gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h);
+ gdk_device_get_position (device, NULL, &x, &y);
+#else
GdkDisplay *display;
GdkScreen *screen;
gint w, h;
@@ -2925,6 +2935,7 @@ on_fullscreen_controls_leave_notify_event (GtkWidget *widget,
gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h);
gdk_display_get_pointer (display, &screen, &x, &y, NULL);
+#endif
/* gtk seems to emit leave notify when clicking on tool items,
* work around it by checking the coordinates