Skip to content

Commit 82dc6d1

Browse files
committed
Windows: Fix a bug where windows with non-native titlebars could be maximised to the wrong size
This issue presented after the following sequence of steps: - Display a window with a non-native titlebar - Maximise it - Click the taskbar icon to minimise it - Click the taskbar icon again to maximise it After being maximised for the second time, the window bounds were too large for the display. This is because the check in WM_NCCALCSIZE was failing to determine the target monitor for the window, and therefore failing to adjust the new area appropriately. We now determine the target monitor based on the proposed new bounds of the new window, rather than the current bounds of the window, which may not be meaningful if the window is minimised.
1 parent e890736 commit 82dc6d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/juce_gui_basics/native/juce_Windowing_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4006,7 +4006,7 @@ class HWNDComponentPeer final : public ComponentPeer
40064006
// so that the client area exactly fills the available space.
40074007
if (isFullScreen())
40084008
{
4009-
const auto monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONULL);
4009+
const auto monitor = MonitorFromRect (param, MONITOR_DEFAULTTONULL);
40104010

40114011
if (monitor == nullptr)
40124012
return 0;

0 commit comments

Comments
 (0)