diff -ru fresh.qemu/sdl.c qemu/sdl.c --- fresh.qemu/sdl.c Thu Jul 15 13:18:14 2004 +++ qemu/sdl.c Thu Jul 15 13:23:39 2004 @@ -40,6 +40,7 @@ static int gui_fullscreen; static int gui_key_modifier_pressed; static int gui_keysym; +static int saved_grab_with_sdl; static void sdl_update(DisplayState *ds, int x, int y, int w, int h) { @@ -347,8 +348,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; @@ -357,8 +360,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(); } @@ -391,10 +396,13 @@ 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(); + grab_with_sdl = saved_grab_with_sdl; } vga_invalidate_display(); vga_update_display(); @@ -525,7 +533,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) { sdl_grab_end(); } break; diff -ru fresh.qemu/vl.c qemu/vl.c --- fresh.qemu/vl.c Thu Jul 15 13:18:33 2004 +++ qemu/vl.c Thu Jul 15 13:29:52 2004 @@ -138,6 +138,7 @@ int graphic_width = 800; int graphic_height = 600; int graphic_depth = 15; +int grab_with_sdl = 1; TextConsole *vga_console; /***********************************************************/ @@ -2438,6 +2439,7 @@ QEMU_OPTION_cirrusvga, QEMU_OPTION_g, QEMU_OPTION_std_vga, + QEMU_OPTION_no_sdl_grab, QEMU_OPTION_monitor, QEMU_OPTION_serial, }; @@ -2491,9 +2493,9 @@ { "localtime", 0, QEMU_OPTION_localtime }, { "isa", 0, QEMU_OPTION_isa }, { "std-vga", 0, QEMU_OPTION_std_vga }, + { "no-sdl-grab", 0, QEMU_OPTION_no_sdl_grab }, { "monitor", 1, QEMU_OPTION_monitor }, { "serial", 1, QEMU_OPTION_serial }, - /* temporary options */ { "pci", 0, QEMU_OPTION_pci }, { "cirrusvga", 0, QEMU_OPTION_cirrusvga }, @@ -2791,6 +2793,9 @@ break; case QEMU_OPTION_std_vga: cirrus_vga_enabled = 0; + break; + case QEMU_OPTION_no_sdl_grab: + grab_with_sdl = 0; break; case QEMU_OPTION_g: { diff -ru fresh.qemu/vl.h qemu/vl.h --- fresh.qemu/vl.h Thu Jul 15 13:18:36 2004 +++ qemu/vl.h Thu Jul 15 13:24:07 2004 @@ -241,6 +241,7 @@ extern int graphic_width; extern int graphic_height; extern int graphic_depth; +extern int grab_with_sdl; /* XXX: make it dynamic */ #if defined (TARGET_PPC)