Integrated: 8368021: Window buttons of extended RTL stage are on the wrong side
Michael Strauß
mstrauss at openjdk.org
Wed Oct 1 17:36:55 UTC 2025
On Sat, 27 Sep 2025 04:56:51 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
> When an extended stage is shown with RTL orientation (either using a RTL window + `Scene.nodeOrientation == INHERIT`, or using a LTR window and `Scene.nodeOrientation == RIGHT_TO_LEFT`), the default window buttons are placed on the wrong side of the window. This bug only manifests on Windows and Linux, both of which use `HeaderButtonOverlay` to render the default window buttons.
>
> `HeaderButtonOverlay` is not a part of the scene graph, it is shown on top of the scene graph as an overlay (like the warning overlay that appears when entering full-screen mode). For [CSS-related reasons](https://github.com/openjdk/jfx/pull/1605#issuecomment-2967977276), the parent of an overlay is the scene root (but the scene root doesn't know that). This implementation detail can mess up the calculation of orientation flags and mirroring transforms in `Node`, as depending on the `NodeOrientation` of the root node, the code may mistakenly mirror (or not mirror) the orientation.
>
> The solution I've come up with is as follows: the overlay node is marked with the `Node.INHERIT_ORIENTATION_FROM_SCENE` flag, which causes it to resolve its effective orientation against the scene only, and never against the root node. With this change, the effective orientation and mirroring transforms are computed correctly.
>
> The easiest way to test this fix is with Monkey Tester -> Tools -> Stage Tester.
This pull request has now been integrated.
Changeset: 52e3d63e
Author: Michael Strauß <mstrauss at openjdk.org>
URL: https://git.openjdk.org/jfx/commit/52e3d63e95fa9f3c95b39a13ed4f900e7a5c3f34
Stats: 132 lines in 6 files changed: 102 ins; 5 del; 25 mod
8368021: Window buttons of extended RTL stage are on the wrong side
Reviewed-by: angorya, kcr, zelmidaoui
-------------
PR: https://git.openjdk.org/jfx/pull/1921
More information about the openjfx-dev
mailing list