Linux setResizeLimits()

Is anyone using setResizeLimits() successfully in their DocumentWindow constructor on linux?

So far I'm not able to constrain the main window with this, where the same code works fine on windows and osx.

I notice that the Introjucer also behaves this way.



1 Like

I know this is an old post, but I'm finding the same issue. Is anyone else having this issue? Is there any way I can help get this resolved?

1 Like

I don't think the LinuxComponentPeer class checks the constraints. Might be a to-do-list item for us, unless you want to have a look at how the other OSes handle that and have a go at implementing it yourself.. Don't think we'll have time to look at this for at least a month or so.

Thanks for the quick response, Jules! If I have time, I'll take a look and see what I can do. Otherwise I'll just have to be patient.

1 Like

Same problem on Ubuntu 17.04

1 Like

issue still present in 2019 … pls fix this :confused:


It seems always the case on Ubuntu 20.04 LTS.
Am i wrong?
Is there any chance to get it works.

Thanks for bringing this to our attention. The X11 API is such that we can’t validate custom constrainers in quite the same way as on macOS/Windows. However, we can at least honour the requested min/max width/height:

Hopefully this patch implements the functionality you need. Please let us know if you encounter any problems with this change.

It seems to work fine. Thanks.

For future readers ; following might help you. :grinning:

I don’t want to create another thread, so let me mention here that setResizeLimits behaves differently in combination with the maximise button on different platforms and for the native and JUCE title bars. I tested it with a simple GUI project with the line setResizeLimits (400, 200, 800, 600) added in the MainWindow constructor.

Windows 10:

  • native title bar: the window appears in the top left with 800x600 size, immediately returns to its previous size when dragged
  • JUCE title bar: full screen

MacOS (BigSur, M1):

  • native title bar: full screen
  • JUCE title bar: the window appears in the top left 800x600 size, cannot be dragged at all

Linux (Ubuntu 18.04):

  • native title bar: full screen
  • JUCE title bar: full screen

Shouldn’t it either scale to full screen in all cases or just to its resize limits?

Thanks, I think you’re right to point out the inconsistencies in the existing behaviour. The old behaviour is quite confusing and buggy. I’ve tried to improve things in the following series of commits:

The goal is that the behaviour should be almost identical on Linux and Windows, where the windowing models are quite similar. The fullscreen button will always set the window to fullscreen, regardless of the resize limits. If you don’t want to allow the window to enter full-screen mode, disable the full-screen button when creating a DocumentWindow.

On macOS, the situation is a bit more nuanced because there are a couple of different ‘full-screen’ behaviours: zooming, in which the window resizes to its maximum/best size without entering full-screen mode; and true full-screen, in which the window moves to its own dedicated desktop. The full-screen button on the native titlebar should work as expected (enter fullscreen by default, or zoom to the smaller of the window’s max size and the monitor’s size if option-clicked). For the non-native titlebar, only the zooming behaviour is implemented.

Hopefully that is all a bit more intuitive. Please let me know if you have any questions/concerns, or if you encounter any problems after updating to the newest version of JUCE on the develop branch.

1 Like

Thanks, I think that’s it, now it’s consistent! If I observe something strange, I’ll report.