mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Just noticed yesterday that initial window sizing is broken on
Windows for puzzles with status bars, because the initial call to check_window_size is given the window size _without_ the status bar and assumes that that has to be big enough for the whole thing _with_ the status bar, so it shrinks everything by a little bit. So now we resize the window to take account of the status bar before calling check_window_size(), and the problem seems to have gone away. [originally from svn r5975]
This commit is contained in:
14
windows.c
14
windows.c
@ -522,13 +522,23 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error)
|
|||||||
r.right - r.left, r.bottom - r.top,
|
r.right - r.left, r.bottom - r.top,
|
||||||
NULL, NULL, inst, NULL);
|
NULL, NULL, inst, NULL);
|
||||||
|
|
||||||
if (midend_wants_statusbar(fe->me))
|
if (midend_wants_statusbar(fe->me)) {
|
||||||
|
RECT sr;
|
||||||
fe->statusbar = CreateWindowEx(0, STATUSCLASSNAME, "ooh",
|
fe->statusbar = CreateWindowEx(0, STATUSCLASSNAME, "ooh",
|
||||||
WS_CHILD | WS_VISIBLE,
|
WS_CHILD | WS_VISIBLE,
|
||||||
0, 0, 0, 0, /* status bar does these */
|
0, 0, 0, 0, /* status bar does these */
|
||||||
fe->hwnd, NULL, inst, NULL);
|
fe->hwnd, NULL, inst, NULL);
|
||||||
else
|
/*
|
||||||
|
* Now resize the window to take account of the status bar.
|
||||||
|
*/
|
||||||
|
GetWindowRect(fe->statusbar, &sr);
|
||||||
|
GetWindowRect(fe->hwnd, &r);
|
||||||
|
SetWindowPos(fe->hwnd, NULL, 0, 0, r.right - r.left,
|
||||||
|
r.bottom - r.top + sr.bottom - sr.top,
|
||||||
|
SWP_NOMOVE | SWP_NOZORDER);
|
||||||
|
} else {
|
||||||
fe->statusbar = NULL;
|
fe->statusbar = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
HMENU bar = CreateMenu();
|
HMENU bar = CreateMenu();
|
||||||
|
Reference in New Issue
Block a user