Fix widget jumping between monitors (#43) + monitor chooser - #48
Closed
androosio wants to merge 3 commits into
Closed
Fix widget jumping between monitors (#43) + monitor chooser#48androosio wants to merge 3 commits into
androosio wants to merge 3 commits into
Conversation
On multi-monitor setups the widget remembered its taskbar by a positional index into a geometry-sorted list. That order is unstable across explorer restarts and display changes, so the index would resolve to the wrong monitor (often a vertical secondary screen) and get re-saved. Identify the target taskbar by the monitor's stable device name instead: - native_interop exposes each taskbar's monitor device name and primary flag. - resolve_taskbar_index prefers the remembered monitor, then the primary monitor's taskbar, and only then a positional index. - attach_to_taskbar briefly waits for the remembered monitor's taskbar to appear after an explorer restart instead of falling back immediately. - drag-to-another-taskbar records the dropped monitor; Reset position clears the remembered monitor and re-attaches to the primary. - taskbar_monitor is persisted in settings.json (backward compatible). Also adds CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On multi-monitor setups, Settings now has a Monitor submenu listing each detected taskbar (with the primary one marked). Picking one re-attaches the widget to that monitor's taskbar and remembers it. New menu strings are localized across all 10 languages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Opening the Start menu/search makes the taskbar briefly drop out of EnumWindows (~5s) even though its HWND is still valid. The watchdog read that as an explorer restart and relaunched the process, wiping the widget. Guard the watchdog with IsWindow on the stored taskbar handle: if it still exists, treat it as a transient enumeration blip and skip. Only relaunch when the handle is truly gone for TASKBAR_MISSING_TICKS consecutive checks. Fix originally by André Escocard (andreescocard) in CodeZeno PR CodeZeno#47. Co-Authored-By: André Escocard <andreescocard@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes the widget randomly jumping to the wrong monitor on multi-monitor setups (#43), and adds a way to pick the monitor explicitly.
Fix widget jumping between monitors (#43)
The widget remembered its taskbar by a positional index into a geometry-sorted list. That order is unstable across explorer restarts and display changes, so the index would resolve to the wrong monitor (often a vertical secondary screen) and then get re-saved.
Now the target taskbar is identified by the monitor's stable device name:
native_interopexposes each taskbar's monitor device name and primary-monitor flag (MonitorFromWindow/GetMonitorInfoW).resolve_taskbar_indexprefers the remembered monitor, then the primary monitor's taskbar, and only then a positional index — so it no longer defaults to whichever taskbar happens to sort first.attach_to_taskbarbriefly waits for the remembered monitor's taskbar to come up after an explorer restart instead of falling back immediately.taskbar_monitoris persisted insettings.json; old settings without it stay backward compatible.Monitor chooser
On multi-monitor setups, Settings → Monitor lists each detected taskbar (the primary one is marked) so you can pick which monitor the widget lives on. New menu strings are localized across all 10 languages.
Also adds
CLAUDE.md.Testing
cargo check/clippypass for the Windows target.🤖 Generated with Claude Code