Skip to content

Fix the startup cursor staying blank after the desktop reveal - #14922

Open
yamz8 wants to merge 7 commits into
omacom:quattrofrom
yamz8:fix/startup-cursor-cold-test-flaky
Open

yamz8 wants to merge 7 commits into
omacom:quattrofrom
yamz8:fix/startup-cursor-cold-test-flaky

Conversation

@yamz8

@yamz8 yamz8 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The startup reveal can restore the normal cursor theme without redrawing the pointer, leaving the blank startup image visible. Hyprland 0.56.2 checks cursor visibility on a 500 ms ticker. Keep the cursor hidden for 600 ms after restoring the Xcursor fallback, then restore the user's visibility, Hyprcursor, and GSettings settings. The compositor-environment recovery markers remain until that delayed reveal finishes, and the shell's one acknowledgement is recorded with them, so a reload that discards the timer resumes the reveal straight away instead of waiting for the 15-second recovery.

The existing cold test counts cursor pixels independently of the fading desktop and stops Quickshell before its compositor during cleanup. The Lua test covers the delayed reveal, retained recovery markers, and resuming the reveal after a reload inside the wait.

Relationship to #14842: the current f11e2f59f2 version of that PR only remembers a completed startup across monitorless reloads; it explicitly excludes this redraw fix. These changes are complementary. They currently conflict in the completion callback: when combining them, write #14842's completed marker inside this PR's delayed callback, when the cursor is actually shown. Reload-before-reveal recovery from #14935 is already upstream.

Validation on this branch after merging quattro at 967bbdd734:

  • The Lua cursor test passes; the same assertions fail against unchanged upstream production code at the expected redraw check. All 125 CLI checks, Bash/Lua syntax, warning-level ShellCheck, and whitespace checks pass.
  • The existing cold-compositor test passes inside an isolated private desktop on the laptop GPU. Its nested renderer cannot initialize inside the VM; the unchanged upstream cold test fails there with the same DRM/EGL initialization error.
  • Separately tested the exact proposed source in a disposable Omarchy VM running Hyprland 0.56.2-4 and Quickshell 0.3.2.r7.g2b4501a-1: a fresh graphical login, full reboot, and an automatically triggered reload inside the 600 ms wait all restore the visible pointer and cursor settings. Ordinary reloads afterwards preserve them.
  • Observed redraw waits were about 600–630 ms. A reload inside the wait now resumes the reveal: the pointer is back about 1.2 s after the reveal started, where it previously stayed hidden until the 15-second fallback (about 16 s). Inspected actual screenshots and timestamped recorded frames showing the hidden and restored pointer.

The VM used its default cursor configuration; this refresh does not claim physical GPU or laptop reboot coverage. Validation observers lived outside the production module. The VM and isolated desktop were cleaned up without changing the laptop's configuration.

AI-assisted with Claude Code and Codex.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues remain.

Summary

Keeps the cursor hidden for 600 ms after loading the normal theme, then restores the user's cursor settings.

  • The startup cursor waits for its restored theme before showing the pointer.

No new actionable issues were found. Both earlier, unnumbered findings were withdrawn after yamz8 explained that reload-before-reveal recovery was handled separately.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Desktop reveal starts] --> B[Load normal cursor theme]
  B --> C[Save acknowledgement and keep cursor hidden]
  C --> D[Wait 600 ms]
  D --> E[Clear recovery markers and restore user settings]
  C --> F[Configuration reload]
  F --> G[Read saved acknowledgement]
  G --> D
Loading

Reviews (9) · Last reviewed commit: "Merge quattro, resetting the X11 root cu..." · Reviewed by Greptile

Comment thread default/hypr/startup-cursor.lua Resolved
@yamz8

yamz8 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@jandrusk

Copy link
Copy Markdown

Complementary to #14842 (reload wiping Lua state) and distinct from #15002’s env workaround. The 600ms invisible→restore timer matches Hyprland’s 500ms cursor.invisible check — nice.

Please coordinate with #14842 so both the reveal-redraw path and the reload-restore path land; together they cover the #14932 / #14969 / #14836 cluster.

@ekollof

ekollof commented Oct 12, 2026 •

Copy link
Copy Markdown

@jandrusk @yamz8 I tested the redraw and reload fixes together and incorporated #14922's commit 75a79688 into #14842 as 340062a1c. Follow-up test synchronization fixes are bea4708d6 and f09c5d489.

There was one coordination change: #14842 previously marked its compositor-specific phase done and deleted the saved settings immediately on completion. Those actions now happen inside the 600ms delayed reveal, so both the pending phase and capture survive a Lua reset during that window. Duplicate completions do not reschedule the reveal, and an old callback cannot finish a different recovery. The XWayland reset and final theme fallback are retained.

Results on this machine:

  • 9/9 fresh nested-compositor cold/reload/reveal runs passed, including one recorded run. The pointer was absent in initial frames and visible after reveal; screenshots and the short recording were inspected.
  • 2/2 additional fresh-compositor runs reloaded during the 600ms redraw wait. Both retained the original Adwaita theme and pending state, recovered via the production 15s fallback, reached the instance's done phase, removed the capture, and kept the pointer visible after a subsequent healthy reload.
  • The file-based Lua regression passes, including delay-state persistence, duplicate completion, stale callback rejection and the previous data-only snapshot coverage.
  • Review identified a race in the optional interruption test, and a rerun exposed an immediate screenshot taken during reload rendering. The fixture now holds the first redraw until reload is issued, then lets the real 15s fallback run; healthy reload checks assert the Lua state and wait for a rendered frame. The final deterministic interruption suite passes 3/3. Production timing remains 600ms.

Additional real-desktop verification on Mercury-2, a separate host with different hardware from the machine used for the initial nested-compositor tests, accessed over SSH. Its session was freshly loaded (Hyprland 0.56.2-4, Quickshell 0.3.2-4, integration 554b6ac92 containing 340062a1c):

  • Three compositor reloads, a shell restart, and another reload preserved done state, normal theme, Hyprcursor and GSettings synchronization, with no config errors.
  • A disposable XWayland window consistently reported a nontransparent 24x24 left_ptr with 272 visible pixels via XFixes. A screenshot visibly confirms the pointer over that window; input-driven hiding was temporarily disabled for that capture and restored by config reload afterward. No software-cursor override was applied (no_hardware_cursors remained 2).
  • Two induced pending-state recoveries interrupted the real 600ms redraw delay. One also explicitly installed the blank startup theme first. Both resumed pending with the original default theme and recovered through the production fallback, ending visible/done with the snapshot removed and Hyprcursor/GSettings synchronization restored. The original Xcursor path/theme were restored; probe windows were closed.

The nested fixture uses a no-animation launcher and disables XWayland; Mercury supplies the separate XWayland evidence. These are induced recovery and reload tests, not a new physical login/reboot test or proof that every spontaneous cursor report has this cause. #15002 is not included. Fresh Greptile review on f09c5d489 is 5/5, explicitly confirms the earlier test timing issue is fixed, and has no unresolved threads.

The combined branch preserves both fixes and their ancestry. Maintainers can land #14922 first and refresh #14842, or land the combined branch; either way the delayed redraw must retain pending recovery state until the actual reveal.

@omarchybot

Copy link
Copy Markdown
Collaborator

This pull request was read but not classified or verified this run. Classifying needs two models to agree, and the second opinion (Codex Medium) was reachable but refused because the day's review budget had run out. So nothing was run on a worker, no labels went on, and it will be picked up again.

Two things anyone picking this up should know:

  • It no longer merges cleanly into quattro. Fix seven busted tests on quattro #15386 rewrote the final cursor check in test/shell.d/hyprland-startup-cursor-cold-test.sh: it now moves the pointer into the nested compositor and falls back to the compositor's own state when screencopy frames carry no cursor. That change conflicts with this branch's cursor_pixels() helper in the same loop. default/hypr/startup-cursor.lua and test/shell.d/hyprland-startup-cursor-test.sh still merge cleanly.
  • Both commits here, 03e56c55d and 75a796882, are also in Keep the cursor visible after a completed startup reloads without monitors #14842, which builds on them (340062a1c onward) and merges cleanly. Which of the two should land is a call for the maintainer.

Waiting on: the next review pass, and the maintainer's choice between this and #14842.

yamz8 and others added 2 commits October 16, 2026 19:16
Hyprland only redraws the pointer in the restored theme when it is shown
again, so revealing without a hide left the blank startup cursor in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yamz8
yamz8 force-pushed the fix/startup-cursor-cold-test-flaky branch from 75a7968 to 9d95033 Compare October 16, 2026 16:39
@yamz8

yamz8 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto quattro. The only conflict was the cold cursor test, which #15386 rewrote. I kept its pointer warp and fallback checks and only moved the capture into the cursor_pixels() helper. The startup cursor tests pass, and the cold test passed 8 out of 8 runs. @ekollof has also folded these commits into #14842, so either PR can land; if #14842 goes first, I'll close this one.

@omarchybot omarchybot added the bug Something isn't working label Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 9d9503303, now rebased onto quattro. Claude Opus 5.5 and Codex Medium classified it separately and agreed that it is a bug fix, so it has the bug label.

It was compared with #14842, the other open pull request for the startup cursor. #14842 already contains this fix: it merged your two earlier commits (03e56c55d, 75a796882) with their history, and its head 8d7c29575 still hides the cursor for 600 ms before restoring it in default/hypr/startup-cursor.lua. It also has the cursor_pixels() helper and stops Quickshell before the compositor in the cold test. It is built on #15386, and it also covers reload recovery and the XWayland root cursor, which this pull request does not. Nothing here is missing from #14842, so there is nothing to carry over into it.

#14842 was opened first and includes this change, so that is the one omabot will verify, and this pull request is not being brought to ready beside it. Codex Medium compared the two separately and reached the same conclusion; that is agreement with this reading, and its independence is not guaranteed. Because only one of the two will be merged, nothing was run on a worker for this one.

Waiting on the maintainer to choose between them. As you said, if #14842 lands first this one can be closed.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again at d84a32c, your merge of quattro (967bbdd). Claude Opus 5.5 and Codex Medium classified it separately and agreed it is a bug fix. Since the last review, #14842 has been narrowed to its done marker and no longer carries this redraw change, so this pull request is no longer covered by it and was worked on its own.

The bug did not reproduce on a worker. I logged in cold on a fresh Omarchy VM (Hyprland 0.56.2), once with quattro and once with this branch as OMARCHY_PATH. I waited until the reveal had finished, then compared a grim -c capture at the pointer with the same region after warping the pointer away. On quattro, the normal arrow is already drawn right after the reveal, about 60 changed pixels, before any pointer motion. That held with the default cursor setting and with cursor:no_hardware_cursors = 0 forced. This branch draws the same 60 pixels. So the worker can't tell the two apart. The Lua test passes here and fails with only default/hypr/startup-cursor.lua reverted, but it asserts the new sequence rather than the blank pointer. The cold test fails on this branch and on quattro alike, because its nested compositor never starts on the worker. ./test/cli passed.

Why base may already redraw. On quattro, the cold path already hides the pointer in config.reloaded (startup-cursor.lua:96), and the Xcursor fallback is restored while it is still hidden. So a 500 ms visibility check normally applies the hide before the reveal, and showing the cursor again reapplies its shape in the new theme. Codex Medium traced this through Hyprland 0.56.2's renderer and cursor manager. Its conclusion: base stays blank only if the reveal finishes before any visibility check has applied the initial hide. That is possible on a faster startup, but nothing here shows it happening, and it isn't specific to hardware cursors. The open reports in this area point elsewhere. #14836 and #14969 are the reload losing the restore, which #14935 addressed. #14932 isolates its blank pointer to the Hyprcursor path.

One cost of the change. restore(true) now clears pending straight away, but the session marker only clears inside the 600 ms timer (:33, :39). A reload inside that window drops the timer. The next config.reloaded then sees an interrupted session, and :66 excludes interrupted sessions from the immediate recovery. The shell has already sent its one restore (shell/services/BackgroundIntro.qml:138), so the pointer stays hidden until the 15 s fallback fires, plus another 600 ms. On quattro, the same reload after the reveal leaves the pointer alone. Your description reports the same recovery path. Codex Medium and muse-spark-1.3-contributor via pi (thinking high) each found it independently of each other. I gave them the worker results but not this finding, and their independence from this session is not guaranteed. Codex also confirmed that a second restore(true) or the 15 s timer firing during the wait does nothing, because of the pending guard.

Overlap with other pull requests. #14580 and #14610 both edit the same restore(true) block, so whichever lands second has to move its commands inside the timer. #16336 deletes test/shell.d/hyprland-startup-cursor-cold-test.sh, which would make this branch's changes to that file moot.

Waiting on you. It needs a way to see the blank pointer on quattro before the delay can be shown to fix it: the machine and steps where quattro leaves the pointer blank after the reveal, or a reproduction that forces the reveal ahead of the first visibility check. The reload window above is also yours to decide: accept the 15 s recovery, or resume a reveal the shell has already acknowledged straight after a reload.

The shell acknowledges the startup reveal only once. A reload inside the
600 ms wait dropped the timer and left the pointer hidden until the 15 s
recovery. Record the acknowledgement for the session and resume the
reveal straight after such a reload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yamz8

yamz8 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review. Pushed d214c1b for the reload window.

Reload inside the 600 ms wait. The shell acknowledges the reveal only once, so restore(true) now records that acknowledgement for the session (OMARCHY_STARTUP_CURSOR_REVEALED) alongside the existing markers, and the delayed callback clears it. A reload that lands inside the wait sees an interrupted session that was already acknowledged and goes straight back into the delayed reveal instead of arming the 15 s recovery. With a reload 250 ms into the reveal, the pointer was back after about 1.2 s; before this commit it stayed hidden for about 16 s. Ordinary reloads and the cold path are unchanged. The Lua test has a case for this, and it fails without the commit.

Reproduction on quattro. I couldn't make quattro leave the pointer blank after the reveal either. A cold login draws the normal arrow straight away, and forcing the recovery path to reveal before a visibility tick also redraws it. So I can't show this delay fixing an observed failure. It only covers the ordering Codex traced, where the reveal completes before any visibility check has applied the initial hide. Whether that guard is worth carrying without a reproduction is the maintainer's call.

A monitorless reload inside the reveal's wait took the cold branch and put the blank startup theme back into the compositor environment. The resumed reveal never passes through the restore that repairs it, so applications launched afterwards inherited the blank Xcursor theme.

Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: muse-spark-1.3-contributor <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again at d214c1b. Claude Opus 5.5 and Codex Medium classified it separately and again agreed it is a bug fix.

The reload fix works on a worker. On a fresh Omarchy VM (Hyprland 0.56.2), I logged in cold and ran hyprctl reload from inside the 600 ms wait, after the shell's restore. I confirmed the reload by checking that the Lua state had been reset. With d214c1b, the cursor settings came back 0.83 s after the reload, and a capture at the pointer showed the normal arrow, 60 changed pixels against the same region with the pointer moved away. With the previous head's startup-cursor.lua, the same reload left nothing drawn at the pointer 3 s later, and the pointer came back only at 16.0 s. An ordinary reload after the reveal still leaves the pointer alone. ./test/cli passed (125 checks). The Lua test passes, and it fails at the new assertion with only default/hypr/startup-cursor.lua taken from the previous head.

Fixed on your branch: a monitorless reload inside the wait. In that case cold is true, so config.reloaded put XCURSOR_THEME=omarchy-startup and the startup cursor path back into the compositor environment (startup-cursor.lua:89-91). The resumed restore(true) never passes through the restore that repairs them, so anything the compositor launched afterwards would have inherited the blank Xcursor theme. I pushed dbafb9b, which keeps the normal theme for a reveal the shell has already acknowledged (if cold and not revealed). It also extends the Lua test to resume once with no monitors and once with one. The test fails without the Lua change. Nothing else changes: a true cold start and an unacknowledged reveal without monitors still use the blank theme. The live reload check above gives the same result on dbafb9b, 0.82 s and the arrow drawn. A reload with no monitors was not run live, because the worker's only output can't be dropped inside 600 ms. That case is covered by the Lua test and by reading the code.

Who checked it. I asked Codex Medium and muse-spark-1.3-contributor via pi (thinking high) to check a list of reload cases, a monitorless one among them, without saying what I expected. Each traced the monitorless case to this defect. Their independence from this session is not guaranteed. In a second round on dbafb9b, both found nothing further. muse also suggested that the resumed path might lose the Xcursor theme or capture the hidden state as your setting. I rejected both: the worker shows the arrow drawn and cursor.invisible false after the resumed reveal, and Codex traced both through Hyprland's reload.

Still open, and the maintainer's call. Neither the worker nor you could make quattro leave the pointer blank after a cold reveal. The 600 ms delay therefore guards an ordering traced from Hyprland's source rather than a failure anyone has seen. Against that, every startup now carries an extra timer, a third environment marker, and 600 ms of hidden pointer after the shell's restore. Both reviewers judged that not proportionate without a reproduction. Whether to carry it as a guard is left to the maintainer. The overlaps from the last review still stand: #14580 and #14610 edit the same restore(true) block, #16336 deletes the cold test this branch edits, and #14842 conflicts in the completion callback, as your description says.

omacom#14580 resets the XWayland root cursor in restore(true). Here that call moves into the 600 ms reveal, after the user's cursor settings are back, so the root cursor is reset at the same point in the reveal as on quattro.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again at b37b849, your merge of quattro. Claude Opus 5.5 and Codex Medium classified it separately and again agreed it is a bug fix. Your change to default/hypr/startup-cursor.lua and the Lua test is line for line what was reviewed at dbafb9b. The cold-test edits dropped out because quattro removed that test.

Merged quattro again, since it had started to conflict. #14580 landed on quattro after your merge. It resets the XWayland root cursor with xsetroot -cursor_name left_ptr at the end of restore(true), the same block this pull request moves into the 600 ms reveal, so both files conflicted. I pushed 1480bfa, a merge commit with no rebase and no force push. It puts the xsetroot call inside the delayed reveal, after your cursor settings and setcursor are restored, so the root cursor is reset at the same point in the reveal as on quattro. A reload inside the wait and the 15 s fallback both go back through restore(true), so they reach it too. The test keeps your reveal timer and #14580's commands list and assertions. The pull request merges cleanly again.

Checked on a fresh Omarchy VM at 1480bfa:

  • ./test/cli passed.
  • hyprland-startup-cursor-test.sh passed, and it fails with only the xsetroot line removed.
  • With the worker's shell and OMARCHY_PATH pointed at this branch, after login the cursor was visible again, Hyprcursor was back on, and the normal arrow was drawn at the pointer (about 60 changed pixels against the same region with the pointer moved away).

Codex Medium and muse-wonder (thinking high) reviewed the merge and found no defect in it. That is agreement with this reading, and its independence is not guaranteed.

What is still open is the same as before. The blank pointer this delay guards against has not been reproduced on quattro, on a worker or by you. Both reviewers again judged the 600 ms delay on every login not proportionate without a reproduction. So this has no verified or ready label, and whether to carry the guard is the maintainer's call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants