On Fri, 6 Nov 2026 13:55:28 GMT, Lukasz Kostyra <[email protected]> wrote:

> Got another question to the implementation, and also when testing the change 
> I found one problem which is a discrepancy in behavior in Linux, attached a 
> reproducer to it.
> 
> In short, when a Stage has called `setResizable(false)` and then we request 
> it to maximize or fullscren by `setMaximize(true)`/`setFullScreen(true)` the 
> latter request is ignored on Linux. This doesn't happen on Windows. I think 
> `setResizable` was just supposed to block UI-based resizing, but 
> programmatically resizing the Stage should still work.
> 
> For the record, I'm pretty sure this behaved like this also before your 
> changes, but I figured I'd mention it. I think it's a problem somewhere in 
> `glass_window.cpp` in `process_map` with window constraints, but I didn't dig 
> too deep into it.
> 
> Reproducer:
> 
> ```
> import javafx.application.Application;
> import javafx.application.Platform;
> import javafx.scene.Group;
> import javafx.scene.Scene;
> import javafx.stage.Stage;
> 
> public class NonResizableMaximizeBug extends Application {
>     @Override
>     public void start(Stage stage) {
>         stage.setScene(new Scene(new Group()));
>         stage.setTitle("FixedSizeMaximizeBug");
> 
>         stage.setWidth(640);
>         stage.setHeight(480);
>         stage.setResizable(false);
>         stage.setMaximized(true);
> 
>         stage.show();
>     }
> 
>     public static void main(String[] args) {
>         launch(args);
>     }
> }
> ```

I noticed this as well. I would classify it as a minor behavioral difference 
between platforms.

I worked around it by allowing programmatic resizing even when the window is 
marked as non-resizable. At least on Mutter/GNOME, the default behavior is to 
discard resize requests when the window is not resizable.

However, allowing a non-resizable window to be maximized doesn't seem right.

On Windows, you can resize a maximized window, and it will remain maximized 
while accepting the resize request. On Linux (Mutter/GNOME), if I remember 
correctly, requesting a resize will unmaximize the window to apply the resize. 
Another minor behavioral difference between platforms in my opinion.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2139#issuecomment-6687236650

Reply via email to