Whenever a window becomes fullscreen, shown, unminimized, and has input focus it will change the display to the corresponding fullscreen video mode.
If it loses any of those properties the desktop mode will be restored. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404243
This commit is contained in:
parent
c77842705f
commit
b98089ee2a
4 changed files with 114 additions and 74 deletions
|
@ -652,17 +652,16 @@ SDL_SetKeyboardFocus(int index, SDL_WindowID windowID)
|
|||
int i;
|
||||
SDL_bool focus;
|
||||
|
||||
if (!keyboard || (keyboard->focus == windowID)) {
|
||||
if (!keyboard) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* See if the current window has lost focus */
|
||||
if (keyboard->focus) {
|
||||
if (keyboard->focus && keyboard->focus != windowID) {
|
||||
focus = SDL_FALSE;
|
||||
for (i = 0; i < SDL_num_keyboards; ++i) {
|
||||
SDL_Keyboard *check;
|
||||
if (i != index) {
|
||||
check = SDL_GetKeyboard(i);
|
||||
SDL_Keyboard *check = SDL_GetKeyboard(i);
|
||||
if (check && check->focus == keyboard->focus) {
|
||||
focus = SDL_TRUE;
|
||||
break;
|
||||
|
@ -678,21 +677,8 @@ SDL_SetKeyboardFocus(int index, SDL_WindowID windowID)
|
|||
keyboard->focus = windowID;
|
||||
|
||||
if (keyboard->focus) {
|
||||
focus = SDL_FALSE;
|
||||
for (i = 0; i < SDL_num_keyboards; ++i) {
|
||||
SDL_Keyboard *check;
|
||||
if (i != index) {
|
||||
check = SDL_GetKeyboard(i);
|
||||
if (check && check->focus == keyboard->focus) {
|
||||
focus = SDL_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!focus) {
|
||||
SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_GAINED,
|
||||
0, 0);
|
||||
}
|
||||
SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_GAINED,
|
||||
0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1,
|
|||
return 0;
|
||||
}
|
||||
window->flags |= SDL_WINDOW_MINIMIZED;
|
||||
SDL_OnWindowMinimized(window);
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||
if (window->flags & SDL_WINDOW_MAXIMIZED) {
|
||||
|
@ -98,6 +99,7 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1,
|
|||
return 0;
|
||||
}
|
||||
window->flags &= ~(SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED);
|
||||
SDL_OnWindowRestored(window);
|
||||
break;
|
||||
case SDL_WINDOWEVENT_ENTER:
|
||||
if (window->flags & SDL_WINDOW_MOUSE_FOCUS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue