qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH v7 3/4] ui: add fix for GTK Pause key handling on Win32
Date: Wed, 17 Jan 2018 16:47:16 +0000	[thread overview]
Message-ID: <20180117164717.15855-4-berrange@redhat.com> (raw)
In-Reply-To: <20180117164717.15855-1-berrange@redhat.com>

Versions of GTK prior to 3.22 did not correctly set the keyval
field when VK_PAUSE was received on Windows.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 ui/gtk.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 1217160724..188c40eef5 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1206,7 +1206,14 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
         return TRUE;
     }
 
-    if (key->keyval == GDK_KEY_Pause) {
+    if (key->keyval == GDK_KEY_Pause
+#ifdef G_OS_WIN32
+        /* for some reason GDK does not fill keyval for VK_PAUSE
+         * See https://bugzilla.gnome.org/show_bug.cgi?id=769214
+         */
+        || key->hardware_keycode == VK_PAUSE
+#endif
+        ) {
         qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
                                         key->type == GDK_KEY_PRESS);
         return TRUE;
-- 
2.14.3

  parent reply	other threads:[~2018-01-17 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 16:47 [Qemu-devel] [PATCH v7 0/4] Convert frontends to use keycodemapdb Daniel P. Berrange
2018-01-17 16:47 ` [Qemu-devel] [PATCH v7 1/4] ui: convert the SDL2 frontend to keycodemapdb Daniel P. Berrange
2018-01-17 16:47 ` [Qemu-devel] [PATCH v7 2/4] ui: convert GTK and SDL1 frontends " Daniel P. Berrange
2018-01-17 16:47 ` Daniel P. Berrange [this message]
2018-01-17 16:47 ` [Qemu-devel] [PATCH v7 4/4] ui: ignore hardware keycode 255 on win32 Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117164717.15855-4-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).