From: Bernhard Beschow <shentey@gmail.com>
To: "Volker Rümelin" <vr_qemu@t-online.de>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>
Subject: Re: [PATCH v2 1/1] ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows
Date: Tue, 18 Apr 2023 18:14:58 +0000 [thread overview]
Message-ID: <B538687F-5D53-4463-A620-574855BBA103@gmail.com> (raw)
In-Reply-To: <20230418065652.7152-1-vr_qemu@t-online.de>
Am 18. April 2023 06:56:52 UTC schrieb "Volker Rümelin" <vr_qemu@t-online.de>:
>Windows sends an extra left control key up/down input event for
>every right alt key up/down input event for keyboards with
>international layout. Since commit 830473455f ("ui/sdl2: fix
>handling of AltGr key on Windows") QEMU uses a Windows low level
>keyboard hook procedure to reliably filter out the special left
>control key and to grab the keyboard on Windows.
>
>The SDL2 version 2.0.16 introduced its own Windows low level
>keyboard hook procedure to grab the keyboard. Windows calls this
>callback before the QEMU keyboard hook procedure. This disables
>the special left control key filter when the keyboard is grabbed.
>
>To fix the problem, disable the SDL2 Windows low level keyboard
>hook procedure.
>
>Reported-by: Bernhard Beschow <shentey@gmail.com>
>Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
FWIW:
Tested-by: Bernhard Beschow <shentey@gmail.com>
>---
> ui/sdl2.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/ui/sdl2.c b/ui/sdl2.c
>index 00aadfae37..9d703200bf 100644
>--- a/ui/sdl2.c
>+++ b/ui/sdl2.c
>@@ -855,7 +855,10 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
> #ifdef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR /* only available since SDL 2.0.8 */
> SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
> #endif
>+#ifndef CONFIG_WIN32
>+ /* QEMU uses its own low level keyboard hook procecure on Windows */
> SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
>+#endif
> #ifdef SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED
> SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0");
> #endif
next prev parent reply other threads:[~2023-04-18 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 6:52 [PATCH v2 0/1] SDL2: fix handling of the AltGr key on Windows again Volker Rümelin
2023-04-18 6:56 ` [PATCH v2 1/1] ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows Volker Rümelin
2023-04-18 18:14 ` Bernhard Beschow [this message]
2023-04-24 3:33 ` Stefan Weil via
2023-05-10 18:43 ` Bernhard Beschow
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=B538687F-5D53-4463-A620-574855BBA103@gmail.com \
--to=shentey@gmail.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
--cc=vr_qemu@t-online.de \
/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).