summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2018-06-01 10:29:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-04 15:15:00 +0100
commitdfc9dd521bedc0ab2591c22d699be5cc6e159e57 (patch)
treec499c2e87c59ef6e3b5a55e9e0a8b1babb8a0d24 /meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
parentf1eb044403b543e1122656d89280ea5202783a78 (diff)
downloadpoky-dfc9dd521bedc0ab2591c22d699be5cc6e159e57.tar.gz
qemu: refresh patches with devtool and make them applicable with git
(From OE-Core rev: e8fb42f3a54e8b8d68ae216a48534fa745ea99f1) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch b/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
new file mode 100644
index 0000000000..add5d8b02f
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
@@ -0,0 +1,70 @@
1From 273e1af49d3e0a58bb9464369deb2652f243e649 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Wed, 18 Sep 2013 14:04:54 +0100
4Subject: [PATCH] sdl.c: allow user to disable pointer grabs
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When the pointer enters the Qemu window it calls SDL_WM_GrabInput, which calls
10XGrabPointer in a busyloop until it returns GrabSuccess. However if there's already
11a pointer grab (screen is locked, a menu is open) then qemu will hang until the
12grab can be taken. In the specific case of a headless X server on an autobuilder, once
13the screensaver has kicked in any qemu instance that appears underneath the
14pointer will hang.
15
16I'm not entirely sure why pointer grabs are required (the documentation
17explicitly says it doesn't do grabs when using a tablet, which we are) so wrap
18them in a conditional that can be set by the autobuilder environment, preserving
19the current grabbing behaviour for everyone else.
20
21Upstream-Status: Pending
22Signed-off-by: Ross Burton <ross.burton@intel.com>
23Signed-off-by: Eric BĂ©nard <eric@eukrea.com>
24---
25 ui/sdl.c | 12 ++++++++++--
26 1 file changed, 10 insertions(+), 2 deletions(-)
27
28diff --git a/ui/sdl.c b/ui/sdl.c
29index 7b71a9a..29ce1b9 100644
30--- a/ui/sdl.c
31+++ b/ui/sdl.c
32@@ -63,6 +63,10 @@ static SDL_PixelFormat host_format;
33 static int scaling_active = 0;
34 static Notifier mouse_mode_notifier;
35 static int idle_counter;
36+#ifndef True
37+#define True 1
38+#endif
39+static doing_grabs = True;
40
41 #define SDL_REFRESH_INTERVAL_BUSY 10
42 #define SDL_MAX_IDLE_COUNT (2 * GUI_REFRESH_INTERVAL_DEFAULT \
43@@ -431,14 +435,16 @@ static void sdl_grab_start(void)
44 }
45 } else
46 sdl_hide_cursor();
47- SDL_WM_GrabInput(SDL_GRAB_ON);
48+ if (doing_grabs)
49+ SDL_WM_GrabInput(SDL_GRAB_ON);
50 gui_grab = 1;
51 sdl_update_caption();
52 }
53
54 static void sdl_grab_end(void)
55 {
56- SDL_WM_GrabInput(SDL_GRAB_OFF);
57+ if (doing_grabs)
58+ SDL_WM_GrabInput(SDL_GRAB_OFF);
59 gui_grab = 0;
60 sdl_show_cursor();
61 sdl_update_caption();
62@@ -986,6 +992,8 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
63 * This requires SDL >= 1.2.14. */
64 setenv("SDL_DISABLE_LOCK_KEYS", "1", 1);
65
66+ doing_grabs = (getenv("QEMU_DONT_GRAB") == NULL);
67+
68 flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
69 if (SDL_Init (flags)) {
70 fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",