diff options
-rw-r--r-- | mate-panel/panel-toplevel.c | 8 | ||||
-rw-r--r-- | mate-panel/panel-widget.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c index 0aeef374..b58b3394 100644 --- a/mate-panel/panel-toplevel.c +++ b/mate-panel/panel-toplevel.c @@ -857,12 +857,20 @@ static gboolean panel_toplevel_warp_pointer_increment(PanelToplevel* toplevel, i { GdkScreen *screen; GdkWindow *root_window; +#if GTK_CHECK_VERSION(3, 0, 0) + GdkDevice *device; +#endif int new_x, new_y; screen = gtk_window_get_screen (GTK_WINDOW (toplevel)); root_window = gdk_screen_get_root_window (screen); +#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(root_window)))); + gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET(root_window)), device, &new_x, &new_y, NULL); +#else gdk_window_get_pointer (root_window, &new_x, &new_y, NULL); +#endif switch (keyval) { case GDK_KEY_Up: diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c index 183f5f91..10796e8b 100644 --- a/mate-panel/panel-widget.c +++ b/mate-panel/panel-widget.c @@ -2255,6 +2255,9 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel) int pos; int movement; GtkWidget *applet; +#if GTK_CHECK_VERSION(3, 0, 0) + GdkDevice *device; +#endif GSList *forb; GdkModifierType mods; AppletData *ad; @@ -2310,8 +2313,13 @@ panel_widget_applet_move_to_cursor (PanelWidget *panel) } } +#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, NULL, NULL, &mods); +#else gdk_window_get_pointer(gtk_widget_get_window (GTK_WIDGET(panel)), NULL,NULL,&mods); +#endif movement = PANEL_SWITCH_MOVE; |