[libdazzle] shortcuts: use toplevel when no focus
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: use toplevel when no focus
- Date: Sat, 17 Jun 2017 22:58:50 +0000 (UTC)
commit 2994cee072f45edd5b37f256e97872d9ae005717
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 17 15:57:50 2017 -0700
shortcuts: use toplevel when no focus
If there is no focus widget, we want to assume the whole of the toplevel
is focused so that we can still resolve actions/controllers/etc.
src/shortcuts/dzl-shortcut-manager.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-manager.c b/src/shortcuts/dzl-shortcut-manager.c
index 1f93e24..7e82ddb 100644
--- a/src/shortcuts/dzl-shortcut-manager.c
+++ b/src/shortcuts/dzl-shortcut-manager.c
@@ -692,6 +692,9 @@ dzl_shortcut_manager_handle_event (DzlShortcutManager *self,
modifier = event->state & gtk_accelerator_get_default_mod_mask ();
widget = focus = gtk_window_get_focus (GTK_WINDOW (toplevel));
+ if (widget == NULL)
+ widget = focus = toplevel;
+
while (widget != NULL)
{
G_GNUC_UNUSED g_autoptr(GtkWidget) widget_hold = g_object_ref (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]