[Xfce4-commits] [apps/xfdashboard] 03/03: Move more code to new GDK API when GTK+ 3.20 or newer is installed to avoid deprecation warnings.
noreply at xfce.org
noreply at xfce.org
Wed Dec 21 18:17:40 CET 2016
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit 12000ff1358c6d234bd7d4b28552e3cea7a01f65
Author: Stephan Haller <nomad at froevel.de>
Date: Wed Dec 21 18:17:25 2016 +0100
Move more code to new GDK API when GTK+ 3.20 or newer is installed to avoid deprecation warnings.
---
libxfdashboard/popup-menu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libxfdashboard/popup-menu.c b/libxfdashboard/popup-menu.c
index 7bbb4b9..f993c14 100644
--- a/libxfdashboard/popup-menu.c
+++ b/libxfdashboard/popup-menu.c
@@ -47,6 +47,7 @@
#include <libxfdashboard/popup-menu.h>
#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <math.h>
@@ -1867,7 +1868,11 @@ void xfdashboard_popup_menu_activate(XfdashboardPopupMenu *self)
{
XfdashboardPopupMenuPrivate *priv;
GdkDisplay *display;
+#if GTK_CHECK_VERSION(3, 20, 0)
+ GdkSeat *seat;
+#else
GdkDeviceManager *deviceManager;
+#endif
GdkDevice *pointerDevice;
gint pointerX, pointerY;
XfdashboardWindowTrackerMonitor *monitor;
@@ -1883,8 +1888,13 @@ void xfdashboard_popup_menu_activate(XfdashboardPopupMenu *self)
/* Move popup menu next to pointer similar to tooltips but keep it on current monitor */
display=gdk_display_get_default();
+#if GTK_CHECK_VERSION(3, 20, 0)
+ seat=gdk_display_get_default_seat(display);
+ pointerDevice=gdk_seat_get_pointer(seat);
+#else
deviceManager=gdk_display_get_device_manager(display);
pointerDevice=gdk_device_manager_get_client_pointer(deviceManager);
+#endif
gdk_device_get_position(pointerDevice, NULL, &pointerX, &pointerY);
monitor=xfdashboard_window_tracker_get_monitor_by_position(priv->windowTracker, pointerX, pointerY);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list