[Xfce4-commits] [apps/xfdashboard] 02/03: Move 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:39 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 954a9250f40533fcdaf5c59eec4ec428142a6678
Author: Stephan Haller <nomad at froevel.de>
Date:   Wed Dec 21 18:12:59 2016 +0100

    Move to new GDK API when GTK+ 3.20 or newer is installed to avoid deprecation warnings.
---
 plugins/hot-corner/hot-corner.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/plugins/hot-corner/hot-corner.c b/plugins/hot-corner/hot-corner.c
index 0ab5bc0..e1e6e21 100644
--- a/plugins/hot-corner/hot-corner.c
+++ b/plugins/hot-corner/hot-corner.c
@@ -53,7 +53,11 @@ struct _XfdashboardHotCornerPrivate
 	XfdashboardApplication					*application;
 	XfdashboardWindowTracker				*windowTracker;
 	GdkWindow								*rootWindow;
+#if GTK_CHECK_VERSION(3, 20, 0)
+	GdkSeat									*seat;
+#else
 	GdkDeviceManager						*deviceManager;
+#endif
 
 	guint									timeoutID;
 	GDateTime								*enteredTime;
@@ -145,7 +149,11 @@ static gboolean _xfdashboard_hot_corner_check_hot_corner(gpointer inUserData)
 	}
 
 	/* Get current position of pointer */
+#if GTK_CHECK_VERSION(3, 20, 0)
+	pointerDevice=gdk_seat_get_pointer(priv->seat);
+#else
 	pointerDevice=gdk_device_manager_get_client_pointer(priv->deviceManager);
+#endif
 	if(!pointerDevice)
 	{
 		g_critical(_("Could not get pointer to determine pointer position"));
@@ -351,7 +359,11 @@ void xfdashboard_hot_corner_init(XfdashboardHotCorner *self)
 	priv->application=xfdashboard_application_get_default();
 	priv->windowTracker=xfdashboard_window_tracker_get_default();
 	priv->rootWindow=NULL;
+#if GTK_CHECK_VERSION(3, 20, 0)
+	priv->seat=NULL;
+#else
 	priv->deviceManager=NULL;
+#endif
 
 	priv->timeoutID=0;
 	priv->enteredTime=NULL;
@@ -368,14 +380,22 @@ void xfdashboard_hot_corner_init(XfdashboardHotCorner *self)
 		if(priv->rootWindow)
 		{
 			display=gdk_window_get_display(priv->rootWindow);
+#if GTK_CHECK_VERSION(3, 20, 0)
+			priv->seat=gdk_display_get_default_seat(display);
+#else
 			priv->deviceManager=gdk_display_get_device_manager(display);
+#endif
 		}
 			else
 			{
 				g_critical(_("Disabling hot-corner plugin because the root window to determine pointer position could not be found."));
 			}
 
+#if GTK_CHECK_VERSION(3, 20, 0)
+		if(priv->seat)
+#else
 		if(priv->deviceManager)
+#endif
 		{
 			/* Start polling pointer position */
 			priv->timeoutID=g_timeout_add(POLL_POINTER_POSITION_INTERVAL,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list