Skip to content

Tests: render in windows that are on no display - #513

Merged
v0lumehi merged 1 commit into
mainfrom
v0lumehi/tests-no-visible-windows
Nov 2, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
v0lumehi/tests-no-visible-windows

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Fix or feature

  • Fix
  • Feature

What and why

While I shared my screen in Teams, windows popped up on my external monitor during swift test. The render and capture tests host SwiftUI views in titled windows at the origin and order them in. A titled window is also moved back onto a screen by AppKit, so even an offscreen frame does not hold for it.

This adds one test helper, OffscreenWindow in frontend/Tests/NX2AppleTests/OffscreenWindow.swift. It sits at (-100000, -100000), is never key or main, and is put back offscreen after the initializer moved it. It is still ordered in, so layout and cacheDisplay work as before. The titled style stays the default because the launcher draws under its transparent title bar. Every NSWindow(contentRect:...) in the tests that is shown now uses it (16 files). setActivationPolicy(.accessory) calls stay. No product code changed.

One side effect: the captures of a 1440x1024 window were cut to the height of the screen before (992 pt on my Mac). They are now the full 1024 pt, so the PNGs no longer depend on the display.

Checked

  • Tests: cd frontend && swift test: 703 tests, 17 skipped, 0 failures, and the pre-push hook passed.
  • Test for a fix: OffscreenWindowTests.testRenderWindowsAreNeverOnAnyDisplay orders in a titled, a borderless and a resizable helper window and asserts that none is on a display, for AppKit (NSApp.windows against NSScreen.screens) and for the window server (CGWindowListCopyWindowInfo). I also ran the whole suite once with a temporary observer that did the same check after every test. It found no window on a display (537 checks). The observer is not in the PR.
  • Visual QA: NX_LAUNCHER_CAPTURE_DIR captures (78 PNGs) and the console captures (24) before and after. Console captures and 47 launcher captures are identical. The others differ only in the random temp path text, or in height as described above. ConsoleTests.testFirstTileRingIsNotClippedAfterScrollingBack passed in every run.
  • Run on a device or Mac: not needed.
  • Not checked: I cannot see the screen, so the check above is by API, not by eye.

Screenshots

None, no visible change.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: not an engine change
  • A change to a launcher view has before and after screenshots above: no view changed
  • No keys, game files or data extracted from a game in the change or the attachments

The render and capture tests hosted their views in titled windows at the origin and ordered them in, so they showed on every screen during swift test. They now use OffscreenWindow: far outside every display, never key, never main, and kept off the screens. A guard test checks it with AppKit and the window server.
@v0lumehi v0lumehi added this to the v1.0.2 milestone Nov 2, 2026
@v0lumehi v0lumehi added enhancement New feature or request launcher The NX2Apple launcher app mac Mac labels Nov 2, 2026
hotkakao pushed a commit to hotkakao/nxnative-romfs-archive that referenced this pull request Nov 2, 2026
…ied as a merge that keeps its tree

PR LNPANDY#115 is the complete version of the sync repair: it drops the fork's
NRO patcher because upstream fixed the same bug itself (3e77816c,
7e0f5971, 337186cf - their data_blocks() starts an NRO's code at 0x80
and their test covers both cases the fork's did), reworks the archive
handle tag to bit 57 for seedds LNPANDY#513's FH_OUT/FH_IN shift, stops the
double ad-hoc signing build_ipa.sh would get now that upstream carries
the entitlements itself, follows the new pwd/errno anchor, and makes
the daily health check use the real .upstream-ref base (issue LNPANDY#105).

A textual merge against main conflicted inside the same GetFileSize
hunks both sides had rewritten, so the three files are taken from the
PR's branch as they are. Verified here: both patcher suites pass
(against seedds main 062cd06e and against the last sync base), and
--old 75065df --new seedds/main --skip-build reaches SYNC OK.

Co-authored-by: v0lumehi
@v0lumehi
v0lumehi merged commit 552d75c into main Nov 2, 2026
14 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/tests-no-visible-windows branch November 2, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request launcher The NX2Apple launcher app mac Mac

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant