diff src/video/win32/SDL_win32window.c @ 1734:f7c667ded87d SDL-1.3

The general code handles restoring video mode/gamma/etc. when the window loses focus. Support for changing fullscreen/windowed mode in progress.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 Jul 2006 18:09:16 +0000
parents 0b1070f2f94d
children
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c	Sun Jul 09 09:02:26 2006 +0000
+++ b/src/video/win32/SDL_win32window.c	Sun Jul 09 18:09:16 2006 +0000
@@ -109,7 +109,7 @@
     }
     if (GetFocus() == hwnd) {
         int index = data->videodata->keyboard;
-        window->flags |= SDL_WINDOW_KEYBOARD_FOCUS;
+        window->flags |= SDL_WINDOW_INPUT_FOCUS;
         SDL_SetKeyboardFocus(index, data->windowID);
 
         if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
@@ -390,20 +390,15 @@
 {
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
 
-    if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
-        if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) {
-            RECT rect;
-            GetClientRect(hwnd, &rect);
-            ClientToScreen(hwnd, (LPPOINT) & rect);
-            ClientToScreen(hwnd, (LPPOINT) & rect + 1);
-            ClipCursor(&rect);
-        } else {
-            SetFocus(hwnd);
-        }
+    if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
+        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
+        RECT rect;
+        GetClientRect(hwnd, &rect);
+        ClientToScreen(hwnd, (LPPOINT) & rect);
+        ClientToScreen(hwnd, (LPPOINT) & rect + 1);
+        ClipCursor(&rect);
     } else {
-        if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) {
-            ClipCursor(NULL);
-        }
+        ClipCursor(NULL);
     }
 }