diff --git a/renderer/linux/src/LinuxWindow.kt b/renderer/linux/src/LinuxWindow.kt index 99e9e1754..3c24b9f0a 100644 --- a/renderer/linux/src/LinuxWindow.kt +++ b/renderer/linux/src/LinuxWindow.kt @@ -342,7 +342,7 @@ internal class LinuxWindow private constructor( x11.setImeSpot(spot.first, spot.second) } - private fun close() { + internal fun close() { scene.close() x11.close() } diff --git a/renderer/linux/test/LinuxWindowTest.kt b/renderer/linux/test/LinuxWindowTest.kt index a2b74e29d..3aaf0d594 100644 --- a/renderer/linux/test/LinuxWindowTest.kt +++ b/renderer/linux/test/LinuxWindowTest.kt @@ -47,6 +47,9 @@ class LinuxWindowTest { "a display server is present and the window did not open: the visual, the colormap, " + "the window or the GL context was refused", ) + // Closed, because the windows of a process share one display connection and the test + // below needs there to be none open to see what a machine with no display server does. + window.close() } @Test diff --git a/renderer/scripts/build-compose.sh b/renderer/scripts/build-compose.sh index 569dad78a..29a9076e0 100755 --- a/renderer/scripts/build-compose.sh +++ b/renderer/scripts/build-compose.sh @@ -41,7 +41,7 @@ REVISION="2eb80c12e7615ef80c7661ea63e0f20651f20a31" # accessibility bridges (the renderer hands them the scene's semantics). It replaces the # backport branch feat/windows-window-backport-57b4a0e, which carried those two fixes on an # older base; multi-window work builds on `extended` itself. -WINDOW_REVISION="2eb80c12e7615ef80c7661ea63e0f20651f20a31" +WINDOW_REVISION="317d380b4c34fc324c47811bd71fa76543510a94" # The commit the Windows build takes. It was its own pin while the Windows Compose lived on a # branch apart from the Compose pin; the fork's `extended` now holds mingwX64 for every Compose UI # module, the skiko build for mingwX64 (extended/skiko/build-skiko-mingw.sh, which also compiles diff --git a/scripts/tests/linux-native-window.test.sh b/scripts/tests/linux-native-window.test.sh index 8dbe46c7f..319c938e6 100755 --- a/scripts/tests/linux-native-window.test.sh +++ b/scripts/tests/linux-native-window.test.sh @@ -230,10 +230,12 @@ grep -Fq 'WindowEvent.RESIZE' <<< "$resize_branch" && grep -Fq 'frames.draw()' < grep -Fq 'Expose ->' "$window" || fail "the window ignores being uncovered" # Events are read in one place, through the guard, because a frame drawn inside a resize draws from -# the middle of reading an event. -grep -Fq 'log.read {' "$window" || - fail "the window reads the display server without the guard that stops a read inside a read" -if [[ "$(grep -v '^import ' "$window" | grep -c 'XNextEvent')" != "1" ]]; then +# the middle of reading an event. With several windows the read is the shared connection's, once +# per turn for every window; the guard is its `reading` flag. +connection="$(dirname "$window")/X11Connection.kt" +grep -Fq 'if (!reading) {' "$connection" || + fail "the connection reads the display server without the guard that stops a read inside a read" +if [[ "$(cat "$connection" "$window" | grep -v '^import ' | grep -c 'XNextEvent')" != "1" ]]; then fail "the window takes events off the queue in more than one place, which is how the rest of a drag gets drained mid-frame" fi