RFR: 8251240: Menus inaccessible on Linux with i3 wm
Thiago Milczarek Sayao
tsayao at openjdk.org
Mon Jul 10 09:04:07 UTC 2023
On Mon, 10 Jul 2023 08:06:34 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> The bug happens because `gdk_window_get_frame_extents` is not returning the correct position when o i3-wm, probably by some bug on the wm itself.
>>
>> Te fix replaces the usage of the function for already known extents value calculation.
>
> modules/javafx.graphics/src/main/native-glass/gtk/glass_window.cpp line 1016:
>
>> 1014: if (frame_type == TITLED) {
>> 1015: GdkRectangle rect;
>> 1016: gdk_window_get_frame_extents(gdk_window, &rect);
>
> Looking at potential regression: in case of a TITLED frame, before this patch you would use `get_frame_extents` and now you will use `get_origin` in all cases. Are there scenario's where this might lead to regression, or is there a way to test this?
`geometry.x` and `y` should point to the top left corner of the window including decorations (on JavaFX logic), then the view position will have the decoration size as x and y. `gdk_window_get_frame_extents` returns the top left position with frame extents (decorations) - all other Gdk/Gtk functions will return position without decorations (because on X11 they are drawn on client side). Somehow `gdk_window_get_frame_extents` is broken on i3-wm, but we already have the frame extents values. I just replaced it by getting normal origins (does not include decorations) and if the frame is TITLED, subtract the frame extents to have the window position accounting decorations.
To test this I:
- [ ] Run the bug example with UNDECORATED window on i3 and mutter (the default gnome wm);
- [ ] Run the bug example with DECORATED window on i3 and mutter (the default gnome wm);
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1173#discussion_r1257946494
More information about the openjfx-dev
mailing list