summaryrefslogtreecommitdiff
path: root/mate-panel/panel-force-quit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mate-panel/panel-force-quit.c')
-rw-r--r--mate-panel/panel-force-quit.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c
index 9d70b590..bc3e6dda 100644
--- a/mate-panel/panel-force-quit.c
+++ b/mate-panel/panel-force-quit.c
@@ -100,14 +100,28 @@ display_popup_window (GdkScreen *screen)
static void
remove_popup (GtkWidget *popup)
{
- GdkWindow *root;
+ GdkWindow *root;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDisplay *display;
+ GdkDevice *pointer;
+ GdkDeviceManager *device_manager;
+#endif
root = gdk_screen_get_root_window (
gtk_window_get_screen (GTK_WINDOW (popup)));
gdk_window_remove_filter (root, (GdkFilterFunc) popup_filter, popup);
gtk_widget_destroy (popup);
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ display = gdk_window_get_display (root);
+ device_manager = gdk_display_get_device_manager (display);
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+
+ gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
+#else
gdk_pointer_ungrab (GDK_CURRENT_TIME);
+#endif
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
}
@@ -292,6 +306,11 @@ panel_force_quit (GdkScreen *screen,
GdkCursor *cross;
GtkWidget *popup;
GdkWindow *root;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDisplay *display;
+ GdkDevice *pointer;
+ GdkDeviceManager *device_manager;
+#endif
popup = display_popup_window (screen);
@@ -300,13 +319,24 @@ panel_force_quit (GdkScreen *screen,
gdk_window_add_filter (root, (GdkFilterFunc) popup_filter, popup);
cross = gdk_cursor_new (GDK_CROSS);
- status = gdk_pointer_grab (root, FALSE, GDK_BUTTON_PRESS_MASK,
- NULL, cross, time);
#if GTK_CHECK_VERSION (3, 0, 0)
+ display = gdk_window_get_display (root);
+ device_manager = gdk_display_get_device_manager (display);
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+
+ status = gdk_device_grab (pointer, root,
+ GDK_OWNERSHIP_NONE, FALSE,
+ GDK_BUTTON_PRESS_MASK,
+ cross, time);
+
g_object_unref (cross);
#else
+ status = gdk_pointer_grab (root, FALSE, GDK_BUTTON_PRESS_MASK,
+ NULL, cross, time);
+
gdk_cursor_unref (cross);
#endif
+
if (status != GDK_GRAB_SUCCESS) {
g_warning ("Pointer grab failed\n");
remove_popup (popup);