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

Linux: Fix maximise when not using native titlebar

X11 cannot maximise windows that have their maximum size set. When not
using the native titlebar we now revert to setting the window bounds
without involving the X11 maximise function.
This commit is contained in:
attila 2021-07-02 20:11:22 +02:00
parent 90ea4cc2ab
commit e867d1dbb4

View file

@ -185,10 +185,14 @@ public:
if (fullScreen != shouldBeFullScreen)
{
XWindowSystem::getInstance()->setMaximised (windowH, shouldBeFullScreen);
const auto usingNativeTitleBar = ((styleFlags & windowHasTitleBar) != 0);
if (usingNativeTitleBar)
XWindowSystem::getInstance()->setMaximised (windowH, shouldBeFullScreen);
if (shouldBeFullScreen)
r = XWindowSystem::getInstance()->getWindowBounds (windowH, parentWindow);
r = usingNativeTitleBar ? XWindowSystem::getInstance()->getWindowBounds (windowH, parentWindow)
: Desktop::getInstance().getDisplays().getDisplayForRect (bounds)->userArea;
if (! r.isEmpty())
setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, r), shouldBeFullScreen);