1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-08 23:24:19 +00:00

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.
This commit is contained in:
reuk 2025-11-04 18:08:38 +00:00
parent e890736965
commit 82dc6d1c7e
No known key found for this signature in database

View file

@ -4006,7 +4006,7 @@ private:
// so that the client area exactly fills the available space.
if (isFullScreen())
{
const auto monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONULL);
const auto monitor = MonitorFromRect (param, MONITOR_DEFAULTTONULL);
if (monitor == nullptr)
return 0;