summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;