Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/visual-tray.yml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ jobs:
mkdir -p ~/.config/sway
cat > ~/.config/sway/config <<'EOF'
output HEADLESS-1 resolution 1920x1080 position 0,0
# Sway tiles every window by default, so our 200x100 fixture
# gets expanded to fill the whole workspace. Match by HTML
# <title> and force floating + explicit size so the visual
# diff is consistent with other platforms.
for_window [title="menubar visual fixture"] floating enable, resize set 200 100, move position 400 200
exec waybar
EOF
- name: Run visual test under ${{ matrix.de }}
Expand Down
10 changes: 10 additions & 0 deletions tests/visual/fixture/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ const mb = menubar({
// through and made the bounds-rect detection see 0 white pixels.
transparent: false,
backgroundColor: '#FFFFFF',
// No window chrome: avoids GNOME Mutter's CSD header bar painting
// a blue/themed strip inside our 200x100 region.
frame: false,
// 200x100 is the *content* size; without this, the window's outer rect
// includes header bar/decorations and the inner HTML viewport ends up
// smaller, throwing off white-pixel counts.
useContentSize: true,
},
});

Expand All @@ -54,6 +61,9 @@ mb.on('ready', () => {
// and the test can no longer detect it. Moving to a fixed mid-screen
// position guarantees no overlap on any platform.
mb.window?.setPosition(400, 200);
// Focus prevents Mutter from rendering the window as "unfocused" with
// a dimming/tint overlay (was producing a navy-blue rect on GNOME).
mb.window?.focus();
// Wait for the WM (especially Mutter on GNOME) to settle the window's
// final position before querying — getBounds() right after showWindow()
// returned a stale/intended coord on GNOME while the actual paint was
Expand Down
Loading