On Mon, 20 Apr 2026 00:37:11 GMT, Thiago Milczarek Sayao <[email protected]> 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. >> >> It refactors the Glass GTK implementation with a primary focus on window >> sizing, positioning, and state management, addressing a number of >> long-standing issues. >> >> Previously, three separate context classes existed, two of which were used >> for Java Web Start and Applets. These have been unified, as they are no >> longer required. >> >> Additional tests have been introduced to improve coverage. Some tests >> produced different results depending on the StageStyle, so they have been >> converted to use `@ParameterizedTest` to exercise multiple styles. >> >> Although the primary focus is XWayland, the changes have also been verified >> to work correctly on Xorg. >> >> This replaces #1789. It removes the use of GdkWindow in favor of GtkWindow, >> reducing risk and simplifying the review process while preserving the same >> set of bug fixes. Additionally, #2025 requires a `GtkWindow` to be used when >> setting the parent of the file chooser dialog. >> >> To show debug messages, build with `-PCONF=DebugNative` and run with >> `-Dglass.gtk.verbose=CATEGORY` >> >> `CATEGORY` can be one or more of: >> - all >> - size >> - position >> - focus >> - state >> - lifecycle >> - input >> - dialog >> >> Multiple categories can be specified by separating them with commas (e.g. >> size,focus,input). >> >> A manual test is provided: >> `java @build/run.args tests/manual/stage/TestStage.java` >> >> I have added constants for delay times in systemTests (`Util.java`) for >> geometry, state, and focus. These can be configured at runtime, for example: >> `-Dtest.geometry.delay=DELAY`. Please let me know if you would prefer these >> to be removed. >> >> When a window property is set, it is reported immediately. However, once it >> reaches the native Glass layer, it may be adjusted or rejected, causing the >> property to be updated again. Introducing a delay helps ensure the final >> state has been applied before it is verified. >> >> Additional testing on other OS versions and manual validation is in progress. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Thiago Milczarek Sayao has updated the pull request incrementally with one > additional commit since the last revision: > > Rollback some changes modules/javafx.graphics/src/main/native-glass/gtk/glass_general.h line 295: > 293: #else > 294: > 295: #define LOG(...) ((void)0) Minor: while it probably won't matter much right now, a preferred syntax here is: #define LOG(...) do {} while(0) It compiles to the same thing (a noop) but it is the most language-conforming statement that can be used basically anywhere without triggering a sudden compiler error. Here there could be a problem when for example we would try to do: if (cond) LOG("success"); else LOG("error"); As a side-note, this also should apply to other LOG macros in this file, but we already have [JDK-8356327](https://bugs.openjdk.org/browse/JDK-8356327) for this, so you can leave them and it will get adjusted there. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2139#discussion_r3123675034
