Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
1733:0b1070f2f94d | 1734:f7c667ded87d |
---|---|
107 window->flags &= ~SDL_WINDOW_MINIMIZED; | 107 window->flags &= ~SDL_WINDOW_MINIMIZED; |
108 } | 108 } |
109 } | 109 } |
110 if (GetFocus() == hwnd) { | 110 if (GetFocus() == hwnd) { |
111 int index = data->videodata->keyboard; | 111 int index = data->videodata->keyboard; |
112 window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; | 112 window->flags |= SDL_WINDOW_INPUT_FOCUS; |
113 SDL_SetKeyboardFocus(index, data->windowID); | 113 SDL_SetKeyboardFocus(index, data->windowID); |
114 | 114 |
115 if (window->flags & SDL_WINDOW_INPUT_GRABBED) { | 115 if (window->flags & SDL_WINDOW_INPUT_GRABBED) { |
116 RECT rect; | 116 RECT rect; |
117 GetClientRect(hwnd, &rect); | 117 GetClientRect(hwnd, &rect); |
388 void | 388 void |
389 WIN_SetWindowGrab(_THIS, SDL_Window * window) | 389 WIN_SetWindowGrab(_THIS, SDL_Window * window) |
390 { | 390 { |
391 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; | 391 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
392 | 392 |
393 if (window->flags & SDL_WINDOW_INPUT_GRABBED) { | 393 if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && |
394 if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) { | 394 (window->flags & SDL_WINDOW_INPUT_FOCUS)) { |
395 RECT rect; | 395 RECT rect; |
396 GetClientRect(hwnd, &rect); | 396 GetClientRect(hwnd, &rect); |
397 ClientToScreen(hwnd, (LPPOINT) & rect); | 397 ClientToScreen(hwnd, (LPPOINT) & rect); |
398 ClientToScreen(hwnd, (LPPOINT) & rect + 1); | 398 ClientToScreen(hwnd, (LPPOINT) & rect + 1); |
399 ClipCursor(&rect); | 399 ClipCursor(&rect); |
400 } else { | 400 } else { |
401 SetFocus(hwnd); | 401 ClipCursor(NULL); |
402 } | |
403 } else { | |
404 if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) { | |
405 ClipCursor(NULL); | |
406 } | |
407 } | 402 } |
408 } | 403 } |
409 | 404 |
410 void | 405 void |
411 WIN_DestroyWindow(_THIS, SDL_Window * window) | 406 WIN_DestroyWindow(_THIS, SDL_Window * window) |