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