Browse Source

Windows: Fix issue where minimising a window could overwrite the last "normal" window bounds

Previously, the following series of steps would leave the window at
full-size on Windows:

- Open a JUCE Window
- Maximise it
- Minimise it
- Click the maximise button

The expected behaviour is that the window should return to its initial
size and position, but instead the window still fills the screen.

This issue wasn't present on Ubuntu/Unity because minimising does not
invoke ComponentPeer::handleMovedOrResized on that platform. It was not
present on macOS because the system is responsible for restoring the
previous window size on that platform.
v6.1.6
reuk 4 years ago
parent
commit
9360c3f4ff
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      modules/juce_gui_basics/windows/juce_ComponentPeer.cpp

+ 3
- 1
modules/juce_gui_basics/windows/juce_ComponentPeer.cpp View File

@@ -322,7 +322,9 @@ void ComponentPeer::handleMovedOrResized()
component.sendVisibilityChangeMessage();
}
if (! isFullScreen())
const auto windowInSpecialState = isFullScreen() || isKioskMode() || nowMinimised;
if (! windowInSpecialState)
lastNonFullscreenBounds = component.getBounds();
}


Loading…
Cancel
Save