]> git.proxmox.com Git - qemu.git/blobdiff - sdl.c
Update for 0.12.4 release
[qemu.git] / sdl.c
diff --git a/sdl.c b/sdl.c
index de63c7f36ec806c26a6a81dad3978c72510d275e..7912c9159dc6cf4d125e6f143617db19a3d4625e 100644 (file)
--- a/sdl.c
+++ b/sdl.c
@@ -407,24 +407,30 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
 
 static void sdl_update_caption(void)
 {
-    char buf[1024];
+    char win_title[1024];
+    char icon_title[1024];
     const char *status = "";
 
     if (!vm_running)
         status = " [Stopped]";
     else if (gui_grab) {
-        if (!alt_grab)
-            status = " - Press Ctrl-Alt to exit grab";
-        else
+        if (alt_grab)
             status = " - Press Ctrl-Alt-Shift to exit grab";
+        else if (ctrl_grab)
+            status = " - Press Right-Ctrl to exit grab";
+        else
+            status = " - Press Ctrl-Alt to exit grab";
     }
 
-    if (qemu_name)
-        snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status);
-    else
-        snprintf(buf, sizeof(buf), "QEMU%s", status);
+    if (qemu_name) {
+        snprintf(win_title, sizeof(win_title), "QEMU (%s)%s", qemu_name, status);
+        snprintf(icon_title, sizeof(icon_title), "QEMU (%s)", qemu_name);
+    } else {
+        snprintf(win_title, sizeof(win_title), "QEMU%s", status);
+        snprintf(icon_title, sizeof(icon_title), "QEMU");
+    }
 
-    SDL_WM_SetCaption(buf, "QEMU");
+    SDL_WM_SetCaption(win_title, icon_title);
 }
 
 static void sdl_hide_cursor(void)
@@ -519,6 +525,7 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state
 static void toggle_full_screen(DisplayState *ds)
 {
     gui_fullscreen = !gui_fullscreen;
+    do_sdl_resize(real_screen->w, real_screen->h, real_screen->format->BitsPerPixel);
     if (gui_fullscreen) {
         scaling_active = 0;
         gui_saved_grab = gui_grab;
@@ -553,12 +560,14 @@ static void sdl_refresh(DisplayState *ds)
         case SDL_KEYDOWN:
         case SDL_KEYUP:
             if (ev->type == SDL_KEYDOWN) {
-                if (!alt_grab) {
-                    mod_state = (SDL_GetModState() & gui_grab_code) ==
-                                gui_grab_code;
-                } else {
+                if (alt_grab) {
                     mod_state = (SDL_GetModState() & (gui_grab_code | KMOD_LSHIFT)) ==
                                 (gui_grab_code | KMOD_LSHIFT);
+                } else if (ctrl_grab) {
+                    mod_state = (SDL_GetModState() & KMOD_RCTRL) == KMOD_RCTRL;
+                } else {
+                    mod_state = (SDL_GetModState() & gui_grab_code) ==
+                                gui_grab_code;
                 }
                 gui_key_modifier_pressed = mod_state;
                 if (gui_key_modifier_pressed) {