diff options
author | raveit65 <[email protected]> | 2018-06-28 15:11:14 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-06-28 22:24:59 +0200 |
commit | 9009c4e1258171b72157f899dacde2b0306d0fa6 (patch) | |
tree | f8da786a4a48dd00f2f68d8507756262cbdb6ce5 | |
parent | cb34c543087b2d3718c8366cb707e1fe30520129 (diff) | |
download | mate-panel-9009c4e1258171b72157f899dacde2b0306d0fa6.tar.bz2 mate-panel-9009c4e1258171b72157f899dacde2b0306d0fa6.tar.xz |
panel-force-quit: replace deprecated gdk_device_grab
-rw-r--r-- | mate-panel/panel-force-quit.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c index 90f5065e..6603597b 100644 --- a/mate-panel/panel-force-quit.c +++ b/mate-panel/panel-force-quit.c @@ -315,17 +315,24 @@ popup_filter (GdkXEvent *gdk_xevent, return GDK_FILTER_CONTINUE; } +static void +prepare_root_window (GdkSeat *seat, + GdkWindow *window, + gpointer user_data) +{ + gdk_window_show_unraised (window); +} + void panel_force_quit (GdkScreen *screen, guint time) { GdkGrabStatus status; GdkCursor *cross; + GdkSeatCapabilities caps; GtkWidget *popup; GdkWindow *root; GdkDisplay *display; - GdkDevice *pointer; - GdkDevice *keyboard; GdkSeat *seat; popup = display_popup_window (screen); @@ -335,23 +342,18 @@ panel_force_quit (GdkScreen *screen, gdk_window_add_filter (root, (GdkFilterFunc) popup_filter, popup); cross = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_CROSS); + caps = GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_KEYBOARD; display = gdk_window_get_display (root); seat = gdk_display_get_default_seat (display); - pointer = gdk_seat_get_pointer (seat); - keyboard = gdk_device_get_associated_device (pointer); - status = gdk_device_grab (pointer, root, - GDK_OWNERSHIP_NONE, FALSE, - GDK_BUTTON_PRESS_MASK, - cross, time); + status = gdk_seat_grab (seat, root, + caps, FALSE, + cross, NULL, + prepare_root_window, + NULL); g_object_unref (cross); - status = gdk_device_grab (keyboard, root, - GDK_OWNERSHIP_NONE, FALSE, - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, - NULL, time); - if (status != GDK_GRAB_SUCCESS) { g_warning ("Pointer grab failed\n"); remove_popup (popup); |