Repository navigation
fix(desktop): outline froze on the first click; panel opens as a desktop tool starts - #189
Merged
Merged
Conversation
…pens as a tool starts The cursor's follow() held its lock and then called moving(), which took the same lock again: the outline's thread waited on itself forever at the bot's first action with a point. The outline stopped following its window, and Windows turned the frozen window into a gray "not responding" ghost over the owner's screen. moving() is now worked out under the lock already held, and the daemon turns off window ghosting so a busy outline can never cover the screen. The desktop panel also opens as soon as a desktop tool starts in the chat, not only after the first reading or action came back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two problems the owner reported after installing #187/#188:
Cause 1: a lock waiting on itself (#187)
outline_cursor::followheld theMOTIONmutex, then calledmoving(), which lockedMOTIONagain. That deadlocked the outline's thread the first time the bot acted at a point. After that:Fix:
moving()is now computed from the guard already held (still()).DisableProcessWindowsGhosting()on the outline thread, so a busy overlay can never cover the screen in gray.followon a thread with a 2 s timeout; this would have hung before.Cause 2: the panel opened late, after the first
desktop.changeduseFollowBotnow also opens the desktop panel when adesktop_*tool starts running in the chat (chat.item, statusrunning), with the same 2-minute rule. App test added.Checked live on this PC (owner away; dev daemon, Haiku bot with the whole desktop):
The screenshots needed a dev copy without
WDA_EXCLUDEFROMCAPTURE, which keeps the overlays out of captures.Incident during the test
Windows 11 Notepad reuses one window with tabs. The bot typed into the owner's unsaved note in the active tab.
Value.SetValueclears Notepad's undo, so Ctrl+Z could not help. I restored the text from the bot's own reading of it, which was 46 characters and not clipped. The only unknown is whether the original separators were line breaks or spaces. The owner has been told. From then on, tests used a test-only app.