mirror of
https://github.com/yawut/SDL.git
synced 2026-09-12 11:06:49 -05:00
If we're fullscreen on a single-head system and lose focus, minimize
This commit is contained in:
@@ -1449,6 +1449,12 @@ SDL_OnWindowFocusLost(SDL_Window * window)
|
|||||||
{
|
{
|
||||||
SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
|
SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
|
||||||
|
|
||||||
|
/* If we're fullscreen on a single-head system and lose focus, minimize */
|
||||||
|
if ((window->flags & SDL_WINDOW_FULLSCREEN) &&
|
||||||
|
_this->num_displays == 1) {
|
||||||
|
SDL_MinimizeWindow(window->id);
|
||||||
|
}
|
||||||
|
|
||||||
if (display->gamma && _this->SetDisplayGammaRamp) {
|
if (display->gamma && _this->SetDisplayGammaRamp) {
|
||||||
_this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
|
_this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user