diff options
author | infirit <[email protected]> | 2014-11-22 14:14:27 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-22 15:13:50 +0100 |
commit | b6280f261e91913e6cb1338c844d7aeb2323d82a (patch) | |
tree | cf4a4a08c59530577d7eb90111783a83cb22ee67 | |
parent | ca5abdea1b6a1e5e178dfe63a260b73106f69658 (diff) | |
download | mate-panel-b6280f261e91913e6cb1338c844d7aeb2323d82a.tar.bz2 mate-panel-b6280f261e91913e6cb1338c844d7aeb2323d82a.tar.xz |
Gtk3: Fix use of deprecated gdk_display_get_pointer()
Replaced gdk_display_get_pointer() by gdk_device_get_position()
Taken from gnome-panel commit: c5111b57d5241f8e4e9f420df1a904f66fa2e89d
From: Germán Póo-Caamaño <[email protected]>
-rw-r--r-- | mate-panel/panel-toplevel.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c index 8c8b5561..76b816a8 100644 --- a/mate-panel/panel-toplevel.c +++ b/mate-panel/panel-toplevel.c @@ -1296,9 +1296,17 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel) GdkDisplay *display; GdkScreen *screen; GtkWidget *widget; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkDeviceManager *device_manager; + GdkDevice *pointer; +#endif int x, y; display = gdk_display_get_default (); +#if GTK_CHECK_VERSION (3, 0, 0) + device_manager = gdk_display_get_device_manager (display); + pointer = gdk_device_manager_get_client_pointer (device_manager); +#endif widget = GTK_WIDGET (toplevel); if (!gtk_widget_get_realized (widget)) @@ -1306,7 +1314,11 @@ static gboolean panel_toplevel_contains_pointer(PanelToplevel* toplevel) screen = NULL; x = y = -1; +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_device_get_position (pointer, &screen, &x, &y); +#else gdk_display_get_pointer (display, &screen, &x, &y, NULL); +#endif if (screen != gtk_window_get_screen (GTK_WINDOW (toplevel))) return FALSE; |