- Remember maximized window state

This commit is contained in:
Magnus Norddahl 2017-07-09 15:12:31 +02:00
parent afe1199b69
commit c8e713b067

View file

@ -56,6 +56,7 @@ EXTERN_CVAR (Bool, vid_forceddraw)
CVAR(Int, win_x, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Int, win_y, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, win_maximized, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
extern HWND Window;
@ -382,6 +383,8 @@ void I_SaveWindowedPos ()
win_x = wrect.left;
win_y = wrect.top;
}
win_maximized = IsZoomed(Window) == TRUE;
}
}
@ -409,6 +412,9 @@ void I_RestoreWindowedPos ()
KeepWindowOnScreen (winx, winy, winw, winh, scrwidth, scrheight);
}
MoveWindow (Window, winx, winy, winw, winh, TRUE);
if (win_maximized && !Args->CheckParm("-0"))
ShowWindow(Window, SW_MAXIMIZE);
}
extern int NewWidth, NewHeight, NewBits, DisplayBits;