JDK-8316425 : [linux] Stage.setMaximized() before show() does not persist
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: jfx21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: generic
  • Submitted: 2023-09-18
  • Updated: 2024-08-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
This issue came out as a part of recently added Stage Attributes test (see related issues).

When setting a Stage to be Maximized or FullScreen before calling show(), Stage shows up maximized/fullscreened, however it immediately animates to non-maximized/non-fullscreen state. Run attached test program to see more.

I had one situation where the stage actually started windowed and animated to be maximized, it happened randomly when running the attached app multiple times, but I couldn't reproduce it again.

Issue happened on Fedora 38 (Linux 6.4) VM with X11 window system. Attached program works properly on Windows.
Comments
The origin of the problem is the same as JDK-8337400. This happens for Maximized and FullScreen because JavaFX delays it until the window is shown. It's probably a bug in Mutter. It's reproducible with a simple gtk C program (attached). If fullscreen is set after show(), it fails. But before show(), it succeeds. Compile with: gcc `pkg-config --cflags gtk+-3.0` -o fullscreen fullscreen.c `pkg-config --libs gtk+-3.0`
25-08-2024

Maybe the fix for JDK-8332222 fixes it on the fedora version that fails?
22-05-2024

EDIT: Attached an easy example. Also in the meantime I checked this on MacOS, and it is broken in the same way as for Windows and Linux.
24-02-2024

I experienced the same issue on Windows. I'm pretty sure that this is not bound to the OS, but what a Stage does when it is shown. I could reproduce the problem always when using a Dialog (setMaximized() -> showAndWait()). I also already have a fix which worked for me. Only tested on Windows as of now. How does it behave on Mac? Can file a PR soon. :)
17-02-2024

[~tsayao] Thanks.
25-09-2023

I can take a look in a few days.
22-09-2023

I see this issue on X.org. Interestingly, I also just checked it and this problem does not exist on Wayland (aka. the Stage remains maximized), both on Fedora and Ubuntu 23.04.
19-09-2023

Are you running X.org or Wayland as your display server? We only support the former for now, but would still want to fix any bugs in the latter as and when we can.
19-09-2023

Yes, Fedora and Ubuntu use the same window manager, just different versions of it. There must have been some change in window managers between Ubuntu 22.04 LTS and now - I tested this just now on non-LTS Ubuntu (23.04) and the result is the same as on Fedora. On 22.04 LTS it works fine. It might be a problem-to-come once 24.04 LTS comes out. I also checked dconf-editor and did not find any specific permissions about this, even outside mutter settings.
19-09-2023

I think both ubuntu and fedora uses mutter as the window manager. Maybe install dconf-editor and look at configuration on org/gnome/mutter if there is anything that forbids this.
18-09-2023

[~tsayao] Any ideas about this?
18-09-2023

This one could be specific to the window manager being used on Fedora. I ran the attached test program on Ubuntu 22.04 and it runs fine. [~lkostyra] Can you also run your test on Fedora using JavaFX 20? It's possible that the changes in JDK-8260528 affect this.
18-09-2023