diff options
author | raveit65 <[email protected]> | 2016-08-08 00:15:41 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-09-07 14:43:51 +0200 |
commit | 57476a87183ca22766b2b263fffee70d40f1b4b6 (patch) | |
tree | 9c036f57f43ff9d3e873f983f032e33ed992eb70 | |
parent | 7024dfb18176ef0b429d0dc2768b1053546c76db (diff) | |
download | mate-panel-57476a87183ca22766b2b263fffee70d40f1b4b6.tar.bz2 mate-panel-57476a87183ca22766b2b263fffee70d40f1b4b6.tar.xz |
GTK+-3.20 top-level: use GtkSeat instead of deprecated device pointer
-rw-r--r-- | mate-panel/panel-toplevel.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c index 44760c38..d5263ba6 100644 --- a/mate-panel/panel-toplevel.c +++ b/mate-panel/panel-toplevel.c @@ -444,11 +444,12 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp GdkCursor *cursor; #if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; - GdkDevice *pointer; - GdkDevice *keyboard; #if GTK_CHECK_VERSION (3, 20, 0) GdkSeat *seat; + GdkSeatCapabilities capabilities; #else + GdkDevice *pointer; + GdkDevice *keyboard; GdkDeviceManager *device_manager; #endif #endif @@ -511,11 +512,18 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp display = gdk_window_get_display (window); #if GTK_CHECK_VERSION(3, 20, 0) seat = gdk_display_get_default_seat (display); - pointer = gdk_seat_get_pointer (seat); + capabilities = GDK_SEAT_CAPABILITY_POINTER; + if (grab_keyboard) + capabilities |= GDK_SEAT_CAPABILITY_KEYBOARD; + + gdk_seat_grab (seat, window, capabilities, FALSE, cursor, + NULL, NULL, NULL); + + g_object_unref (cursor); +} #else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); -#endif keyboard = gdk_device_get_associated_device (pointer); gdk_device_grab (pointer, window, @@ -531,6 +539,7 @@ static void panel_toplevel_begin_grab_op(PanelToplevel* toplevel, PanelGrabOpTyp GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL, time_); } +#endif #else gdk_pointer_grab (window, FALSE, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, @@ -548,11 +557,11 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_) GtkWidget *widget; #if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; - GdkDevice *pointer; - GdkDevice *keyboard; #if GTK_CHECK_VERSION (3, 20, 0) GdkSeat *seat; #else + GdkDevice *pointer; + GdkDevice *keyboard; GdkDeviceManager *device_manager; #endif #endif @@ -570,15 +579,16 @@ static void panel_toplevel_end_grab_op (PanelToplevel* toplevel, guint32 time_) display = gtk_widget_get_display (widget); #if GTK_CHECK_VERSION(3, 20, 0) seat = gdk_display_get_default_seat (display); - pointer = gdk_seat_get_pointer (seat); + + gdk_seat_ungrab (seat); #else device_manager = gdk_display_get_device_manager (display); pointer = gdk_device_manager_get_client_pointer (device_manager); -#endif keyboard = gdk_device_get_associated_device (pointer); gdk_device_ungrab (pointer, time_); gdk_device_ungrab (keyboard, time_); +#endif #else gdk_pointer_ungrab (time_); gdk_keyboard_ungrab (time_); @@ -1594,7 +1604,9 @@ void panel_toplevel_update_edges(PanelToplevel* toplevel) PanelFrameEdge edges; PanelFrameEdge inner_edges; PanelFrameEdge outer_edges; +#if !GTK_CHECK_VERSION (3, 0, 0) PanelBackground *background; +#endif int monitor_width, monitor_height; int width, height; gboolean inner_frame = FALSE; |