|
|
4a6991 |
From 0c7e70e4d9b57bcaa26922051d9fc49ebed20af8 Mon Sep 17 00:00:00 2001
|
|
|
4a6991 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
|
|
|
4a6991 |
Date: Thu, 26 Sep 2013 16:29:51 +0200
|
|
|
4a6991 |
Subject: [PATCH] hotkeys: send modifiers before non-modifier key
|
|
|
4a6991 |
|
|
|
4a6991 |
This fixes the "send menu" for hotkeys set with non-modifiers keys. The
|
|
|
4a6991 |
current order of press events is wrong, as it sends first non-modifiers
|
|
|
4a6991 |
keys, and in general ctrl+t will work, t+ctrl will not.
|
|
|
4a6991 |
|
|
|
4a6991 |
https://bugzilla.redhat.com/show_bug.cgi?id=922716
|
|
|
4a6991 |
(cherry picked from commit b80e7f0f2d59dabc6d0e969e8d481e624fa8f67c)
|
|
|
4a6991 |
---
|
|
|
4a6991 |
src/virt-viewer-window.c | 8 +++++---
|
|
|
4a6991 |
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
4a6991 |
|
|
|
4a6991 |
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
|
|
|
4a6991 |
index abe3aa9..2a91fba 100644
|
|
|
4a6991 |
--- a/src/virt-viewer-window.c
|
|
|
4a6991 |
+++ b/src/virt-viewer-window.c
|
|
|
4a6991 |
@@ -629,12 +629,10 @@ accel_key_to_keys(const GtkAccelKey *key)
|
|
|
4a6991 |
guint val;
|
|
|
4a6991 |
GArray *a = g_array_new(FALSE, FALSE, sizeof(guint));
|
|
|
4a6991 |
|
|
|
4a6991 |
- val = key->accel_key;
|
|
|
4a6991 |
- g_array_append_val(a, val);
|
|
|
4a6991 |
-
|
|
|
4a6991 |
g_warn_if_fail((key->accel_mods &
|
|
|
4a6991 |
~(GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)) == 0);
|
|
|
4a6991 |
|
|
|
4a6991 |
+ /* first, send the modifiers */
|
|
|
4a6991 |
if (key->accel_mods & GDK_SHIFT_MASK) {
|
|
|
4a6991 |
val = GDK_Shift_L;
|
|
|
4a6991 |
g_array_append_val(a, val);
|
|
|
4a6991 |
@@ -650,6 +648,10 @@ accel_key_to_keys(const GtkAccelKey *key)
|
|
|
4a6991 |
g_array_append_val(a, val);
|
|
|
4a6991 |
}
|
|
|
4a6991 |
|
|
|
4a6991 |
+ /* only after, the non-modifier key (ctrl-t, not t-ctrl) */
|
|
|
4a6991 |
+ val = key->accel_key;
|
|
|
4a6991 |
+ g_array_append_val(a, val);
|
|
|
4a6991 |
+
|
|
|
4a6991 |
val = GDK_VoidSymbol;
|
|
|
4a6991 |
g_array_append_val(a, val);
|
|
|
4a6991 |
|