[libdazzle] shortcuts: fix tab/shifttab to change focus
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: fix tab/shifttab to change focus
- Date: Thu, 7 Sep 2017 21:26:43 +0000 (UTC)
commit bcd468060afad0e43aa805d4ae5120fee8a56817
Author: Christian Hergert <chergert redhat com>
Date: Thu Sep 7 14:23:45 2017 -0700
shortcuts: fix tab/shifttab to change focus
Since handling our own fallback delivery of events, we lose some of the
default handling by gtkwindow. This allows the toplevel to activate a
signal before we move on to processing application keybindings.
https://bugzilla.gnome.org/show_bug.cgi?id=787275
src/shortcuts/dzl-shortcut-manager.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-manager.c b/src/shortcuts/dzl-shortcut-manager.c
index ea5c565..be047ce 100644
--- a/src/shortcuts/dzl-shortcut-manager.c
+++ b/src/shortcuts/dzl-shortcut-manager.c
@@ -801,15 +801,25 @@ dzl_shortcut_manager_run_global (DzlShortcutManager *self,
static gboolean
dzl_shortcut_manager_run_fallbacks (DzlShortcutManager *self,
GtkWidget *widget,
+ GtkWidget *toplevel,
const DzlShortcutChord *chord)
{
g_assert (DZL_IS_SHORTCUT_MANAGER (self));
g_assert (GTK_IS_WIDGET (widget));
+ g_assert (GTK_IS_WIDGET (toplevel));
g_assert (chord != NULL);
if (dzl_shortcut_chord_get_length (chord) == 1)
{
GApplication *app = g_application_get_default ();
+ GdkModifierType state;
+ guint keyval;
+
+ dzl_shortcut_chord_get_nth_key (chord, 0, &keyval, &state);
+
+ /* See if the toplevel activates this, like Tab, etc */
+ if (gtk_bindings_activate (G_OBJECT (toplevel), keyval, state))
+ return TRUE;
if (GTK_IS_APPLICATION (app))
{
@@ -930,7 +940,7 @@ dzl_shortcut_manager_handle_event (DzlShortcutManager *self,
(match = dzl_shortcut_manager_run_phase (self, event, chord, DZL_SHORTCUT_PHASE_DISPATCH, widget,
focus)) ||
(match = dzl_shortcut_manager_run_phase (self, event, chord, DZL_SHORTCUT_PHASE_BUBBLE, widget,
focus)) ||
(match = dzl_shortcut_manager_run_global (self, event, chord, DZL_SHORTCUT_PHASE_BUBBLE, root,
widget)) ||
- (match = dzl_shortcut_manager_run_fallbacks (self, widget, chord)))
+ (match = dzl_shortcut_manager_run_fallbacks (self, widget, toplevel, chord)))
ret = GDK_EVENT_STOP;
DZL_TRACE_MSG ("match = %d", match);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]