diff options
author | yetist <[email protected]> | 2015-06-18 23:30:57 +0800 |
---|---|---|
committer | infirit <[email protected]> | 2015-08-26 14:23:22 +0200 |
commit | a1cf5afd76d2671ed79ff60f42156b3338bc8166 (patch) | |
tree | 7505a887e07d122cdc9df3ab3f79da7e9293c40e | |
parent | 01bd985d9fecfb64f9e17ebfc1ad76ac8c3a1234 (diff) | |
download | mate-panel-a1cf5afd76d2671ed79ff60f42156b3338bc8166.tar.bz2 mate-panel-a1cf5afd76d2671ed79ff60f42156b3338bc8166.tar.xz |
Gtk3: Don't use deprecated gdk_window_get_pointer
-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; |