Skip to content

Commit 75fdcaa

Browse files
kwellwoodSiegeLord
authored andcommitted
Fix for window resizing on Windows when a menubar is visible.
Enables AdjustWindowRectEx to correctly calculate the window's client area.
1 parent fc2d532 commit 75fdcaa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/win/d3d_disp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,7 @@ static bool d3d_resize_helper(ALLEGRO_DISPLAY *d, int width, int height)
22872287
wi.cbSize = sizeof(WINDOWINFO);
22882288
GetWindowInfo(win_display->window, &wi);
22892289

2290-
AdjustWindowRectEx(&win_size, wi.dwStyle, false, wi.dwExStyle);
2290+
AdjustWindowRectEx(&win_size, wi.dwStyle, GetMenu(win_display->window) ? TRUE : FALSE, wi.dwExStyle);
22912291

22922292
// FIXME: Handle failure (for example if window constraints are active?)
22932293
SetWindowPos(win_display->window, HWND_TOP,

src/win/wgl_disp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ static bool wgl_resize_helper(ALLEGRO_DISPLAY *d, int width, int height)
14061406
wi.cbSize = sizeof(WINDOWINFO);
14071407
GetWindowInfo(win_disp->window, &wi);
14081408

1409-
AdjustWindowRectEx(&win_size, wi.dwStyle, false, wi.dwExStyle);
1409+
AdjustWindowRectEx(&win_size, wi.dwStyle, GetMenu(win_disp->window) ? TRUE : FALSE, wi.dwExStyle);
14101410

14111411
if (!SetWindowPos(win_disp->window, HWND_TOP,
14121412
0, 0,

src/win/wwindow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ void _al_win_set_window_frameless(ALLEGRO_DISPLAY *display, HWND hWnd,
11731173
style |= WS_VISIBLE;
11741174

11751175
GetWindowRect(hWnd, &r);
1176-
AdjustWindowRectEx(&r, style, false, exStyle);
1176+
AdjustWindowRectEx(&r, style, GetMenu(hWnd) ? TRUE : FALSE, exStyle);
11771177

11781178
w = r.right - r.left;
11791179
h = r.bottom - r.top;

0 commit comments

Comments
 (0)