mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 14:38:29 +00:00
Use the default window focus behavior on macOS
We had to work around odd behavior in really old versions of macOS, but the current behavior is great. Fixes https://github.com/libsdl-org/SDL/issues/3954
This commit is contained in:
@@ -261,11 +261,10 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore any fullscreen window
|
||||||
device = SDL_GetVideoDevice();
|
device = SDL_GetVideoDevice();
|
||||||
if (device && device->windows) {
|
if (device && device->windows) {
|
||||||
SDL_Window *window = device->windows;
|
for (int i = 0; i < device->num_displays; ++i) {
|
||||||
int i;
|
|
||||||
for (i = 0; i < device->num_displays; ++i) {
|
|
||||||
SDL_Window *fullscreen_window = device->displays[i]->fullscreen_window;
|
SDL_Window *fullscreen_window = device->displays[i]->fullscreen_window;
|
||||||
if (fullscreen_window) {
|
if (fullscreen_window) {
|
||||||
if (fullscreen_window->flags & SDL_WINDOW_MINIMIZED) {
|
if (fullscreen_window->flags & SDL_WINDOW_MINIMIZED) {
|
||||||
@@ -274,12 +273,6 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->flags & SDL_WINDOW_MINIMIZED) {
|
|
||||||
SDL_RestoreWindow(window);
|
|
||||||
} else {
|
|
||||||
SDL_RaiseWindow(window);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user