summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryetist <[email protected]>2015-06-18 23:25:28 +0800
committerinfirit <[email protected]>2015-08-26 14:23:22 +0200
commit01bd985d9fecfb64f9e17ebfc1ad76ac8c3a1234 (patch)
treea1ac7e50e673459d079c90abfdb9abd163b7ebad
parent618b005f0be401671c9db23869ff30b1ee07afec (diff)
downloadmate-panel-01bd985d9fecfb64f9e17ebfc1ad76ac8c3a1234.tar.bz2
mate-panel-01bd985d9fecfb64f9e17ebfc1ad76ac8c3a1234.tar.xz
Gtk3: Don't use deprecated gtk_widget_get_pointer
-rw-r--r--mate-panel/panel-widget.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c
index c9fbb846..183f5f91 100644
--- a/mate-panel/panel-widget.c
+++ b/mate-panel/panel-widget.c
@@ -1600,6 +1600,9 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
{
GtkWidget *widget;
GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GdkDevice *device;
+#endif
int x,y;
int w,h;
@@ -1612,7 +1615,12 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
!gtk_widget_get_visible(widget))
return FALSE;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget)));
+ gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL);
+#else
gtk_widget_get_pointer(widget, &x, &y);
+#endif
gtk_widget_get_allocation (widget, &allocation);
w = allocation.width;
@@ -2067,12 +2075,20 @@ panel_widget_applet_drag_end (PanelWidget *panel)
int
panel_widget_get_cursorloc (PanelWidget *panel)
{
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GdkDevice *device;
+#endif
int x, y;
gboolean rtl;
g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET(panel))));
+ gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET(panel)), device, &x, &y, NULL);
+#else
gtk_widget_get_pointer (GTK_WIDGET (panel), &x, &y);
+#endif
rtl = gtk_widget_get_direction (GTK_WIDGET (panel)) == GTK_TEXT_DIR_RTL;
if (panel->orient == GTK_ORIENTATION_HORIZONTAL)
@@ -2329,6 +2345,9 @@ static int
move_timeout_handler(gpointer data)
{
PanelWidget *panel = data;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GdkDevice *device;
+#endif
g_return_val_if_fail(PANEL_IS_WIDGET(data),FALSE);
@@ -2348,7 +2367,12 @@ move_timeout_handler(gpointer data)
widget = panel->currently_dragged_applet->applet;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget)));
+ gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL);
+#else
gtk_widget_get_pointer(widget, &x, &y);
+#endif
gtk_widget_get_allocation (widget, &allocation);
w = allocation.width;