Index: sdl.c =================================================================== RCS file: /cvsroot/qemu/qemu/sdl.c,v retrieving revision 1.20 diff -u -u -r1.20 sdl.c --- sdl.c 12 Dec 2004 16:56:30 -0000 1.20 +++ sdl.c 17 Dec 2004 11:11:04 -0000 @@ -39,6 +39,7 @@ static int gui_fullscreen_initial_grab; static int gui_grab_code = KMOD_LALT | KMOD_LCTRL; static uint8_t modifiers_state[256]; +static int saved_grab_with_sdl; static void sdl_update(DisplayState *ds, int x, int y, int w, int h) { @@ -263,8 +264,10 @@ static void sdl_grab_start(void) { - SDL_ShowCursor(0); - SDL_WM_GrabInput(SDL_GRAB_ON); + if(grab_with_sdl) { + SDL_ShowCursor(0); + SDL_WM_GrabInput(SDL_GRAB_ON); + } /* dummy read to avoid moving the mouse */ SDL_GetRelativeMouseState(NULL, NULL); gui_grab = 1; @@ -273,8 +276,10 @@ static void sdl_grab_end(void) { - SDL_WM_GrabInput(SDL_GRAB_OFF); - SDL_ShowCursor(1); + if(grab_with_sdl) { + SDL_WM_GrabInput(SDL_GRAB_OFF); + SDL_ShowCursor(1); + } gui_grab = 0; sdl_update_caption(); } @@ -307,9 +312,11 @@ sdl_resize(ds, screen->w, screen->h); if (gui_fullscreen) { gui_saved_grab = gui_grab; + saved_grab_with_sdl = grab_with_sdl; + grab_with_sdl = 1; sdl_grab_start(); } else { - if (!gui_saved_grab) + if (!gui_saved_grab || !saved_grab_with_sdl) sdl_grab_end(); } vga_invalidate_display(); @@ -445,7 +452,7 @@ } break; case SDL_ACTIVEEVENT: - if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 && + if (grab_with_sdl && gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 && !gui_fullscreen_initial_grab) { sdl_grab_end(); } Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.110 diff -u -u -r1.110 vl.c --- vl.c 12 Dec 2004 22:20:04 -0000 1.110 +++ vl.c 17 Dec 2004 11:11:05 -0000 @@ -136,6 +136,7 @@ int full_screen = 0; TextConsole *vga_console; CharDriverState *serial_hds[MAX_SERIAL_PORTS]; +int grab_with_sdl = 1; /***********************************************************/ /* x86 ISA bus support */ @@ -2672,6 +2673,7 @@ QEMU_OPTION_loadvm, QEMU_OPTION_full_screen, QEMU_OPTION_pidfile, + QEMU_OPTION_no_sdl_grab, }; typedef struct QEMUOption { @@ -2738,6 +2740,7 @@ /* temporary options */ { "pci", 0, QEMU_OPTION_pci }, { "cirrusvga", 0, QEMU_OPTION_cirrusvga }, + { "no-sdl-grab", 0, QEMU_OPTION_no_sdl_grab }, { NULL }, }; @@ -3165,6 +3168,9 @@ case QEMU_OPTION_pidfile: create_pidfile(optarg); break; + case QEMU_OPTION_no_sdl_grab: + grab_with_sdl = 0; + break; } } } Index: vl.h =================================================================== RCS file: /cvsroot/qemu/qemu/vl.h,v retrieving revision 1.63 diff -u -u -r1.63 vl.h --- vl.h 12 Dec 2004 16:56:30 -0000 1.63 +++ vl.h 17 Dec 2004 11:11:05 -0000 @@ -124,6 +124,7 @@ extern int graphic_height; extern int graphic_depth; extern const char *keyboard_layout; +extern int grab_with_sdl; /* XXX: make it dynamic */ #if defined (TARGET_PPC)