[Xfce4-commits] [xfce/libxfce4ui] 01/01: Fix Window has not been made visible when grabbing keyboard (Bug #16054)
noreply at xfce.org
noreply at xfce.org
Sun Nov 3 18:52:02 CET 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/libxfce4ui.
commit 2e7193a93af190a7507cf28fd78314d00928cb3b
Author: Andre Miranda <andreldm at xfce.org>
Date: Sun Nov 3 14:48:34 2019 -0300
Fix Window has not been made visible when grabbing keyboard (Bug #16054)
This is a strange new behavior of gtk3 that seems to require showing
the root window. If this causes anymore trouble, stick to the deprecated
function.
---
libxfce4kbd-private/xfce-shortcut-dialog.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/libxfce4kbd-private/xfce-shortcut-dialog.c b/libxfce4kbd-private/xfce-shortcut-dialog.c
index c3e9630..3c852e8 100644
--- a/libxfce4kbd-private/xfce-shortcut-dialog.c
+++ b/libxfce4kbd-private/xfce-shortcut-dialog.c
@@ -44,6 +44,11 @@ static gboolean xfce_shortcut_dialog_key_pressed (XfceShortcutDialog *
static gboolean xfce_shortcut_dialog_key_released (XfceShortcutDialog *dialog,
GdkEventKey *event);
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void xfce_shortcut_dialog_prepare_grab (GdkSeat *seat,
+ GdkWindow *window,
+ gpointer user_data);
+#endif
struct _XfceShortcutDialogClass
@@ -333,7 +338,6 @@ xfce_shortcut_dialog_create_contents (XfceShortcutDialog *dialog,
}
-
gint
xfce_shortcut_dialog_run (XfceShortcutDialog *dialog,
GtkWidget *parent)
@@ -341,7 +345,6 @@ xfce_shortcut_dialog_run (XfceShortcutDialog *dialog,
#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
GdkSeat *seat;
- gboolean succeed = FALSE;
#endif
gint response = GTK_RESPONSE_CANCEL;
@@ -354,15 +357,11 @@ xfce_shortcut_dialog_run (XfceShortcutDialog *dialog,
display = gtk_widget_get_display (GTK_WIDGET (dialog));
seat = gdk_display_get_default_seat (display);
+ /* Take control on the keyboard */
if (gdk_seat_grab (seat,
gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
- GDK_SEAT_CAPABILITY_KEYBOARD, TRUE, NULL, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
- {
- succeed = TRUE;
- }
-
- /* Take control on the keyboard */
- if (succeed)
+ GDK_SEAT_CAPABILITY_ALL, TRUE, NULL, NULL,
+ xfce_shortcut_dialog_prepare_grab, NULL) == GDK_GRAB_SUCCESS)
#else
/* Take control on the keyboard */
if (G_LIKELY (gdk_keyboard_grab (gtk_widget_get_root_window (GTK_WIDGET (dialog)), TRUE, GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS))
@@ -515,3 +514,15 @@ xfce_shortcut_dialog_get_action_name (XfceShortcutDialog *dialog)
g_return_val_if_fail (XFCE_IS_SHORTCUT_DIALOG (dialog), NULL);
return dialog->action_name;
}
+
+
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void
+xfce_shortcut_dialog_prepare_grab (GdkSeat *seat,
+ GdkWindow *window,
+ gpointer user_data)
+{
+ gdk_window_show_unraised (window);
+}
+#endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list