mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 04:31:09 +00:00
Fix window position after switching from fullscreen
On Windows last_position_x/y (from SDL_GetWindowPosition()) was 0, 0 when coming from fullscreen, and creating a window at position (0, 0) cuts off the window decorations (SDL-Bug?) so the window can't even be moved around anymore. So now we only use the last_position_* if last_position_y was > 24, so we have enough of the title bar to move the window around with the mouse. This is part of #484
This commit is contained in:
parent
a4f56a9650
commit
6ecc083c83
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ ClearDisplayIndices(void)
|
|||
static qboolean
|
||||
CreateSDLWindow(int flags, int w, int h)
|
||||
{
|
||||
if (SDL_WINDOWPOS_ISUNDEFINED(last_position_x) || SDL_WINDOWPOS_ISUNDEFINED(last_position_y))
|
||||
if (SDL_WINDOWPOS_ISUNDEFINED(last_position_x) || SDL_WINDOWPOS_ISUNDEFINED(last_position_y) || last_position_x < 0 ||last_position_y < 24)
|
||||
{
|
||||
last_position_x = last_position_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY((int)vid_displayindex->value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue