summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
diff options
context:
space:
mode:
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.patch72
1 files changed, 0 insertions, 72 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
deleted file mode 100644
index 5b9a1f911c..0000000000
--- a/meta/recipes-devtools/qemu/qemu/0001-sdl.c-allow-user-to-disable-pointer-grabs.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1From c53ddb5acbee56db6423f369b9f9a9b62501b4af 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---
26 ui/sdl.c | 13 +++++++++++--
27 1 file changed, 11 insertions(+), 2 deletions(-)
28
29diff --git a/ui/sdl.c b/ui/sdl.c
30index 190b16f5..aa89471d 100644
31--- a/ui/sdl.c
32+++ b/ui/sdl.c
33@@ -69,6 +69,11 @@ static int idle_counter;
34 static const guint16 *keycode_map;
35 static size_t keycode_maplen;
36
37+#ifndef True
38+#define True 1
39+#endif
40+static doing_grabs = True;
41+
42 #define SDL_REFRESH_INTERVAL_BUSY 10
43 #define SDL_MAX_IDLE_COUNT (2 * GUI_REFRESH_INTERVAL_DEFAULT \
44 / SDL_REFRESH_INTERVAL_BUSY + 1)
45@@ -399,14 +404,16 @@ static void sdl_grab_start(void)
46 }
47 } else
48 sdl_hide_cursor();
49- SDL_WM_GrabInput(SDL_GRAB_ON);
50+ if (doing_grabs)
51+ SDL_WM_GrabInput(SDL_GRAB_ON);
52 gui_grab = 1;
53 sdl_update_caption();
54 }
55
56 static void sdl_grab_end(void)
57 {
58- SDL_WM_GrabInput(SDL_GRAB_OFF);
59+ if (doing_grabs)
60+ SDL_WM_GrabInput(SDL_GRAB_OFF);
61 gui_grab = 0;
62 sdl_show_cursor();
63 sdl_update_caption();
64@@ -945,6 +952,8 @@ static void sdl1_display_init(DisplayState *ds, DisplayOptions *o)
65 * This requires SDL >= 1.2.14. */
66 setenv("SDL_DISABLE_LOCK_KEYS", "1", 1);
67
68+ doing_grabs = (getenv("QEMU_DONT_GRAB") == NULL);
69+
70 flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
71 if (SDL_Init (flags)) {
72 fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",