ITADN

[Wayland] Document-modal modality isn't reported as supported (JOSM)

#577ClosedTheComputerGuy96 创建于 2025-12-16
So there's [this listener](https://github.com/JOSM/josm/blob/3828fd1f414621da33c9255807da5472731d770a/src/org/openstreetmap/josm/gui/util/WindowOnTopListener.java#L26) in JOSM that listens to java.awt.event.WindowFocusListener.windowGainedFocus() events and reacts to them The issue is that those events never get registered in document-modal windows in JOSM (because `Dialog.isModal()` returns `false` with that modality) using the Wayland driver while with XWayland using the X11 driver, they do (which is likely quite important for one case seen below) I guess the [showDialog() function call](https://github.com/JOSM/josm/blob/19439-tested/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java#L476) depends on those events to be a blocking call (on XWayland, the line 478 breakpoint doesn't get hit when the window opens but in Wayland, it does which means it isn't blocking and it leads to the unexpected scenario seen below) The early `showDialog()` function skip causes `e.getValue()` part to be [run](https://github.com/JOSM/josm/blob/19439-tested/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java#L478) before the "OK" button ever gets pressed (which leads to the imagery source information being ignored and thus the new imagery source not being added to the table) The issue also appears with regular Wakefield (commit https://github.com/openjdk/wakefield/commit/0bf2bd412d3323fa534be586b6f449fb77ea2e4c) and even ancient Caciocavallo under nested Weston (so there's fundamentally a shared design flaw with those Wayland driver implementations) I've tried to patch some of the popup checks inside of regular Wakefield but that didn't solve this issue (but also I might be missing something; test patches are welcome as I currently have a cached Wakefield build folder for relatively quick recompiles) Note: I've thought about sending this to the OpenJDK bug tracker directly (but I think it has a code contribution requirement) so posting this issue here is likely the next best thing
关闭于 2025-12-18 3 条评论