On Sun, 27 Jul 2025 13:44:56 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> wrote:
>> This is a continuation to >> [JDK-8236651](https://bugs.openjdk.org/browse/JDK-8236651) and it aims to >> stabilize the linux glass gtk backend. >> >> This is a refactor of the Glass GTK implementation, primarily focused on >> window size, positioning, and state management to resolve numerous issues. >> >> The main change is that GtkWindow (which is a GtkWidget) has been replaced >> with a direct use of GdkWindow for windows. This makes sense because GTK >> includes its own rendering pipeline, whereas JavaFX renders directly to the >> underlying system window (such as the X11 window) via Prism ES2 using GL and >> GLX. Most GTK window-related calls have equivalent GDK calls. Since GDK >> serves as an abstraction over the system window and input events, it aligns >> better with the purposes of Glass. Additionally, using GTK required various >> workarounds to integrate with Glass, which are no longer necessary when >> using GDK directly. >> >> It uses a simple C++ Observable to notify the Java side about changes. This >> approach is more straightforward, as notifications occur at many points and >> the previous implementation was becoming cluttered. >> >> Previously, there were three separate context classes, two of which were >> used for Java Web Start and Applets. These have now been unified, as they >> are no longer required. >> >> Many tests were added to ensure everything is working correctly. I noticed >> that some tests produced different results depending on the StageStyle, so >> they now use @ParameterizedTest to vary the StageStyle. >> >> A manual test is also provided. I did not use MonkeyTester for this, as it >> was quicker to simply run and test manually:`java @build/run.args >> tests/manual/stage/TestStage.java ` >> >> While this is focused on XWayland, everything works on pure Xorg as well. >> >> List of fixed issues: >> >> 1. [[Linux] Stage.setMaximized() before show() does not >> persist](https://bugs.openjdk.org/browse/JDK-8316425) >> 3. [[Linux] Intermittent test failure in >> IconifyTest.canIconifyDecoratedStage](https://bugs.openjdk.org/browse/JDK-8316891) >> 4. [[Linux] Initial window position is not centered on Ubuntu 24.04 / >> Xorg](https://bugs.openjdk.org/browse/JDK-8337400) >> 5. [[Linux] Some of the SizeToSceneTest fail in Ubuntu >> 24.04](https://bugs.openjdk.org/browse/JDK-8353612) >> 6. [[Linux] View size glitch when resizing past max window >> size](https://bugs.openjdk.org/browse/JDK-8355073) >> 7. [RestoreSceneSizeTest fails in Ubuntu >> 24.04](https://bugs.openjdk.org/browse/JDK-8353556) >> 8. [DualWindowTest... > > Thiago Milczarek Sayao has updated the pull request with a new target base > due to a merge or a rebase. The pull request now contains 60 commits: > > - Simplify notify_fullscreen > - Merge branch 'master' into 8354943 > - Remove repaint call (8351867 is fixed) > - Merge branch 'master' into 8354943 > - Remove unused const > - Remove wrong call to enter_fullscreen > - Review changes > - Use process_expose > - Min / Max size improvements > - Invalidate view size on new view > - ... and 50 more: https://git.openjdk.org/jfx/compare/bc433da8...d1842395 I ran all the new tests on Windows 11 and wrote up some notes. I still need to track down some failures in StageAttributesTest.testIconifiedStage and also in StageOwnershipTest related to fullscreen windows. tests/system/src/test/java/test/javafx/stage/CenterOnScreenTest.java line 108: > 106: } > 107: > 108: private void assertStageCentered(StageStyle stageStyle, boolean > useSceneSize) { On Windows the size of a DECORATED or EXTENDED window includes an area around the window containing the invisible drag handles. After sizeToScene is called on my Windows 11 system a DECORATED or EXTENDED window will be 26 units wider than the scene to account for these handles (on my Mac the window will be the same width as the scene). In this test you use a hefty delta for DECORATED windows and a smaller one for EXTENDED and you use the same delta for both width and height. This is causing the centerOnScreenAfterShownWithSceneSize and centerOnScreenWhenShownWithSceneSize test to fail along the X axis for EXTENDED stages since the delta isn't big enough. You might consider querying the stage for it's frame and ensure that the center of the frame is where you expect it rather than make any assumptions about how the scene width relates to the window width. tests/system/src/test/java/test/javafx/stage/SizingTest.java line 155: > 153: @ParameterizedTest(name = PARAMETERIZED_TEST_DISPLAY) > 154: @EnumSource(names = {"DECORATED", "UNDECORATED", "EXTENDED", > "TRANSPARENT", "UTILITY"}) > 155: void minSize(StageStyle stageStyle) { The minSize test is failing on Windows for all stage styles. This is a legitimate bug; the platform is not correctly reporting back to the system that the size change failed. I will enter a bug and you can disable this test until the bug is fixed. (macOS is also failing the minSize and maxSize tests). tests/system/src/test/java/test/robot/javafx/stage/StageOwnershipTest.java line 184: > 182: @ParameterizedTest(name = PARAMETERIZED_TEST_DISPLAY) > 183: @MethodSource("getTestsParams") > 184: void openingModalChildStageWhileMaximizedShouldHaveFocus(StageStyle > stageStyle, Modality modality) This test includes "Focus" in the title but you don't seem to be asserting that the expected window has focus. This is true for several of the other tests in this file. tests/system/src/test/java/test/robot/javafx/stage/StageOwnershipTest.java line 204: > 202: @ParameterizedTest(name = PARAMETERIZED_TEST_DISPLAY) > 203: @MethodSource("getTestsParams") > 204: void openingModalChildStageWhileFullScreenShouldHaveFocus(StageStyle > stageStyle, Modality modality) This test is passing on macOS but it's causing beeps. When the test is being torn down it's trying to hide the fullscreen window first even though it owns a visible modal window. After the window exits fullscreen the OS always tries to make it the key window (!?) even though JavaFX considers it disabled and this is causing Glass to beep and issue the FOCUS_DISABLED message. There's nothing wrong with this test but it is inadvertently testing how the system deals with hiding a window while it owns a modal. But my main concern is that other macOS developers are going to be repeatedly tracking down where the beeps are coming from. tests/system/src/test/java/test/robot/javafx/stage/StageOwnershipTest.java line 267: > 265: @ParameterizedTest(name = PARAMETERIZED_TEST_DISPLAY) > 266: @EnumSource(names = {"DECORATED", "UNDECORATED", "EXTENDED"}) > 267: void iconifyParentShouldHideChildren(StageStyle style) { These tests are failing on Windows for DECORATED and EXTENDED stages. You've got two levels of owned windows and the second level windows aren't getting minimized. This is due to an OS bug, it doesn't recurse through multiple ownership levels. I suppose we could enter a bug on this but I doubt it would ever get fixed. It might make more sense to reduce the test to a single level of ownership. tests/system/src/test/java/test/robot/javafx/stage/StageOwnershipTest.java line 287: > 285: () -> { > 286: assertTrue(stage0.isIconified()); > 287: assertColorDoesNotEqual(COLOR0, stage0); Are these the correct tests? If all stages are iconified you'll be picking up random colors from the desktop. One of those random colors might just match one of the color constants here. ------------- PR Review: https://git.openjdk.org/jfx/pull/1789#pullrequestreview-3073480556 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2243963289 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2243970112 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2244003104 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2244016882 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2243985162 PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2243987440