Locking a window to a specified size now also makes it remember the position, closes #1683.
This commit is contained in:
@@ -1093,6 +1093,9 @@ plat_setfullscreen(int on)
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
|
||||
if (window_remember)
|
||||
SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE);
|
||||
}
|
||||
|
||||
/* Render window. */
|
||||
|
@@ -97,7 +97,7 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM
|
||||
|
||||
if (lock) {
|
||||
vid_resize = 2;
|
||||
window_remember = 0;
|
||||
window_remember = 1;
|
||||
} else {
|
||||
vid_resize = 1;
|
||||
window_remember = 1;
|
||||
@@ -140,11 +140,13 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM
|
||||
if (mouse_capture)
|
||||
ClipCursor(&r);
|
||||
|
||||
if (!(vid_resize & 2) && window_remember) {
|
||||
if (window_remember) {
|
||||
window_x = r.left;
|
||||
window_y = r.top;
|
||||
window_w = r.right - r.left;
|
||||
window_h = r.bottom - r.top;
|
||||
if (!(vid_resize & 2)) {
|
||||
window_w = r.right - r.left;
|
||||
window_h = r.bottom - r.top;
|
||||
}
|
||||
}
|
||||
|
||||
config_save();
|
||||
|
@@ -697,11 +697,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
window_remember = !window_remember;
|
||||
CheckMenuItem(hmenu, IDM_VID_REMEMBER, window_remember ? MF_CHECKED : MF_UNCHECKED);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
if (!(vid_resize & 2) && window_remember) {
|
||||
if (window_remember) {
|
||||
window_x = rect.left;
|
||||
window_y = rect.top;
|
||||
window_w = rect.right - rect.left;
|
||||
window_h = rect.bottom - rect.top;
|
||||
if (!(vid_resize & 2)) {
|
||||
window_w = rect.right - rect.left;
|
||||
window_h = rect.bottom - rect.top;
|
||||
}
|
||||
}
|
||||
config_save();
|
||||
break;
|
||||
@@ -1382,6 +1384,9 @@ ui_init(int nCmdShow)
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
|
||||
if (window_remember)
|
||||
SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE);
|
||||
}
|
||||
|
||||
/* Reset all menus to their defaults. */
|
||||
|
Reference in New Issue
Block a user