From b80e7f0f2d59dabc6d0e969e8d481e624fa8f67c Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 26 Sep 2013 16:29:51 +0200 Subject: hotkeys: send modifiers before non-modifier key This fixes the "send menu" for hotkeys set with non-modifiers keys. The current order of press events is wrong, as it sends first non-modifiers keys, and in general ctrl+t will work, t+ctrl will not. https://bugzilla.redhat.com/show_bug.cgi?id=846006 --- src/virt-viewer-window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/virt-viewer-window.c') diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c index 7593e3c..0f62feb 100644 --- a/src/virt-viewer-window.c +++ b/src/virt-viewer-window.c @@ -632,12 +632,10 @@ accel_key_to_keys(const GtkAccelKey *key) guint val; GArray *a = g_array_new(FALSE, FALSE, sizeof(guint)); - val = key->accel_key; - g_array_append_val(a, val); - g_warn_if_fail((key->accel_mods & ~(GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)) == 0); + /* first, send the modifiers */ if (key->accel_mods & GDK_SHIFT_MASK) { val = GDK_Shift_L; g_array_append_val(a, val); @@ -653,6 +651,10 @@ accel_key_to_keys(const GtkAccelKey *key) g_array_append_val(a, val); } + /* only after, the non-modifier key (ctrl-t, not t-ctrl) */ + val = key->accel_key; + g_array_append_val(a, val); + val = GDK_VoidSymbol; g_array_append_val(a, val); -- cgit