comparison src/video/win32/SDL_win32events.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
451 SDL_SendWindowEvent(data->windowID, 451 SDL_SendWindowEvent(data->windowID,
452 SDL_WINDOWEVENT_MAXIMIZED, 0, 0); 452 SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
453 } 453 }
454 if (keyboard && keyboard->focus != data->windowID) { 454 if (keyboard && keyboard->focus != data->windowID) {
455 SDL_SetKeyboardFocus(index, data->windowID); 455 SDL_SetKeyboardFocus(index, data->windowID);
456
457 if (SDL_GetWindowFlags(data->windowID) &
458 SDL_WINDOW_INPUT_GRABBED) {
459 RECT rect;
460
461 GetClientRect(hwnd, &rect);
462 ClientToScreen(hwnd, (LPPOINT) & rect);
463 ClientToScreen(hwnd, (LPPOINT) & rect + 1);
464 ClipCursor(&rect);
465 }
466 } 456 }
467 /* FIXME: Update keyboard state */ 457 /* FIXME: Update keyboard state */
468 } else { 458 } else {
469 if (keyboard && keyboard->focus == data->windowID) { 459 if (keyboard && keyboard->focus == data->windowID) {
470 SDL_SetKeyboardFocus(index, 0); 460 SDL_SetKeyboardFocus(index, 0);
471
472 if (SDL_GetWindowFlags(data->windowID) &
473 SDL_WINDOW_INPUT_GRABBED) {
474 ClipCursor(NULL);
475 }
476 } 461 }
477 if (minimized) { 462 if (minimized) {
478 SDL_SendWindowEvent(data->windowID, 463 SDL_SendWindowEvent(data->windowID,
479 SDL_WINDOWEVENT_MINIMIZED, 0, 0); 464 SDL_WINDOWEVENT_MINIMIZED, 0, 0);
480 } 465 }
780 ClientToScreen(hwnd, (LPPOINT) & rect); 765 ClientToScreen(hwnd, (LPPOINT) & rect);
781 ClientToScreen(hwnd, (LPPOINT) & rect + 1); 766 ClientToScreen(hwnd, (LPPOINT) & rect + 1);
782 767
783 window_flags = SDL_GetWindowFlags(data->windowID); 768 window_flags = SDL_GetWindowFlags(data->windowID);
784 if ((window_flags & SDL_WINDOW_INPUT_GRABBED) && 769 if ((window_flags & SDL_WINDOW_INPUT_GRABBED) &&
785 (window_flags & SDL_WINDOW_KEYBOARD_FOCUS)) { 770 (window_flags & SDL_WINDOW_INPUT_FOCUS)) {
786 ClipCursor(&rect); 771 ClipCursor(&rect);
787 } 772 }
788 773
789 x = rect.left; 774 x = rect.left;
790 y = rect.top; 775 y = rect.top;