提交 02df4d6f 编写于 作者: J Jan Kiszka 提交者: Anthony Liguori

sdl: Limit sdl_grab_end in handle_activation to Windows hosts

There are scenarios on Linux with some SDL versions where
handle_activation is continuous invoked with state = SDL_APPINPUTFOCUS
and gain = 0 while we grabbed the input. This causes a ping-pong when we
grab the input after an absolute mouse entered the window.

As this sdl_grab_end was once introduced to work around a Windows-only
issue (0294ffb9), limit it to that platform.

CC: Erik Rull <erik.rull@rdsoftware.de>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 822f98d2
......@@ -828,10 +828,14 @@ static void handle_mousebutton(DisplayState *ds, SDL_Event *ev)
static void handle_activation(DisplayState *ds, SDL_Event *ev)
{
#ifdef _WIN32
/* Disable grab if the window no longer has the focus
* (Windows-only workaround) */
if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
!ev->active.gain && !gui_fullscreen) {
sdl_grab_end();
}
#endif
if (!gui_grab && ev->active.gain && is_graphic_console() &&
(kbd_mouse_is_absolute() || absolute_enabled)) {
absolute_mouse_grab();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册