mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-23 19:03:27 +08:00
video: Save pending window events when a window is hidden by the window manager
The window manager might hide/unmap the window when it is minimized, in which case the fullscreen and maximized flags must be preserved as pending flags so the window will be restored to the proper state when shown/mapped on restoration.
This commit is contained in:
parent
9be35d4603
commit
ae4484f4e5
@ -3456,6 +3456,12 @@ void SDL_OnWindowShown(SDL_Window *window)
|
||||
|
||||
void SDL_OnWindowHidden(SDL_Window *window)
|
||||
{
|
||||
/* Store the maximized and fullscreen flags for restoration later, in case
|
||||
* this was initiated by the window manager due to the window being unmapped
|
||||
* when minimized.
|
||||
*/
|
||||
window->pending_flags = (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MAXIMIZED));
|
||||
|
||||
/* The window is already hidden at this point, so just change the mode back if necessary. */
|
||||
SDL_UpdateFullscreenMode(window, SDL_FALSE, SDL_FALSE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user