Commit 43523e9332e79a8ecbcec8444f975b8a705aa9d3

Authored by ths
1 parent 20d8a3ed

-no-frame option for sdl, by Christian Laursen.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2435 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 3 changed files with 16 additions and 3 deletions
... ... @@ -34,6 +34,7 @@ static int gui_grab; /* if true, all keyboard/mouse events are grabbed */
34 34 static int last_vm_running;
35 35 static int gui_saved_grab;
36 36 static int gui_fullscreen;
  37 +static int gui_noframe;
37 38 static int gui_key_modifier_pressed;
38 39 static int gui_keysym;
39 40 static int gui_fullscreen_initial_grab;
... ... @@ -59,6 +60,8 @@ static void sdl_resize(DisplayState *ds, int w, int h)
59 60 flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
60 61 if (gui_fullscreen)
61 62 flags |= SDL_FULLSCREEN;
  63 + if (gui_noframe)
  64 + flags |= SDL_NOFRAME;
62 65  
63 66 width = w;
64 67 height = h;
... ... @@ -469,7 +472,7 @@ static void sdl_cleanup(void)
469 472 SDL_Quit();
470 473 }
471 474  
472   -void sdl_display_init(DisplayState *ds, int full_screen)
  475 +void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
473 476 {
474 477 int flags;
475 478 uint8_t data = 0;
... ... @@ -485,6 +488,9 @@ void sdl_display_init(DisplayState *ds, int full_screen)
485 488 exit(1);
486 489 }
487 490  
  491 + if (no_frame)
  492 + gui_noframe = 1;
  493 +
488 494 flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
489 495 if (SDL_Init (flags)) {
490 496 fprintf(stderr, "Could not initialize SDL - exiting\n");
... ...
... ... @@ -163,6 +163,7 @@ int graphic_height = 600;
163 163 #endif
164 164 int graphic_depth = 15;
165 165 int full_screen = 0;
  166 +int no_frame = 0;
166 167 int no_quit = 0;
167 168 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
168 169 CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
... ... @@ -6345,6 +6346,7 @@ void help(void)
6345 6346 "-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n"
6346 6347 "-snapshot write to temporary files instead of disk image files\n"
6347 6348 #ifdef CONFIG_SDL
  6349 + "-no-frame open SDL window without a frame and window decorations\n"
6348 6350 "-no-quit disable SDL window close capability\n"
6349 6351 #endif
6350 6352 #ifdef TARGET_I386
... ... @@ -6514,6 +6516,7 @@ enum {
6514 6516 QEMU_OPTION_parallel,
6515 6517 QEMU_OPTION_loadvm,
6516 6518 QEMU_OPTION_full_screen,
  6519 + QEMU_OPTION_no_frame,
6517 6520 QEMU_OPTION_no_quit,
6518 6521 QEMU_OPTION_pidfile,
6519 6522 QEMU_OPTION_no_kqemu,
... ... @@ -6597,6 +6600,7 @@ const QEMUOption qemu_options[] = {
6597 6600 { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
6598 6601 { "full-screen", 0, QEMU_OPTION_full_screen },
6599 6602 #ifdef CONFIG_SDL
  6603 + { "no-frame", 0, QEMU_OPTION_no_frame },
6600 6604 { "no-quit", 0, QEMU_OPTION_no_quit },
6601 6605 #endif
6602 6606 { "pidfile", HAS_ARG, QEMU_OPTION_pidfile },
... ... @@ -7224,6 +7228,9 @@ int main(int argc, char **argv)
7224 7228 full_screen = 1;
7225 7229 break;
7226 7230 #ifdef CONFIG_SDL
  7231 + case QEMU_OPTION_no_frame:
  7232 + no_frame = 1;
  7233 + break;
7227 7234 case QEMU_OPTION_no_quit:
7228 7235 no_quit = 1;
7229 7236 break;
... ... @@ -7478,7 +7485,7 @@ int main(int argc, char **argv)
7478 7485 vnc_display_init(ds, vnc_display);
7479 7486 } else {
7480 7487 #if defined(CONFIG_SDL)
7481   - sdl_display_init(ds, full_screen);
  7488 + sdl_display_init(ds, full_screen, no_frame);
7482 7489 #elif defined(CONFIG_COCOA)
7483 7490 cocoa_display_init(ds, full_screen);
7484 7491 #else
... ...
... ... @@ -911,7 +911,7 @@ void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
911 911 unsigned long vga_ram_offset, int vga_ram_size);
912 912  
913 913 /* sdl.c */
914   -void sdl_display_init(DisplayState *ds, int full_screen);
  914 +void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
915 915  
916 916 /* cocoa.m */
917 917 void cocoa_display_init(DisplayState *ds, int full_screen);
... ...