fix(macos): remove redundant activation policy toggle causing duplicate dock icons#1849
Open
ManthanNimodiya wants to merge 2 commits into
Open
fix(macos): remove redundant activation policy toggle causing duplicate dock icons#1849ManthanNimodiya wants to merge 2 commits into
ManthanNimodiya wants to merge 2 commits into
Conversation
Contributor
Author
|
@richiemcilroy, got a new approach -> set Accessory once when the first panel window is created, and never restore Regular while panel windows are still visible. |
Member
|
I guess we just need to try it and see if the behaviour of the main window and camera window showing above a fullscreen app is preserved |
Contributor
Author
|
@richiemcilroy, ok I will try with this approach and let you know at the earliest does that work fine? |
2436b25 to
c00cefa
Compare
Contributor
Author
|
@richiemcilroy, I ran it and noticed no issues, can you confirm on your side also and lmk for any issues, I applied the suggested approach |
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.
What does this PR fix?
Fixes the bug where multiple Cap app icons appear in the macOS Dock when starting a recording.
Root cause
prepare_macos_panel_windoweagerly calledset_activation_policy(Accessory)on every panel window creation. During recording start, multiple panel windows are created in sequence, causing rapidAccessory → Regularpolicy toggling that confuses macOS Dock into registering duplicate app tiles.Fix
Removed the eager
set_activation_policy(Accessory)call — the existingMACOS_PENDING_PANEL_WINDOWScounter already blocks the dock sync from firing during panel creation, making it redundant.Changes
apps/desktop/src-tauri/src/permissions.rs: removed 4 lines fromprepare_macos_panel_windowGreptile Summary
This PR removes four lines from
prepare_macos_panel_windowthat calledset_activation_policy(Accessory)on every panel window creation, which caused rapid policy toggling and duplicate Dock entries during recording start.MACOS_PENDING_PANEL_WINDOWScounter already preventssync_macos_dock_visibilityfrom firing while any panel guard is live (line 172–174), so the eagerAccessorycall was effectively redundant — but with the side effect of triggering macOS Dock re-registration each time.MacosPanelWindowActivationGuard::drop→schedule_macos_dock_visibility_sync→sync_macos_dock_visibility.Confidence Score: 5/5
Safe to merge — removes a provably redundant macOS API call that was the direct cause of the reported bug without altering any other code path.
The deleted call to set_activation_policy(Accessory) served no purpose beyond the counter-gated sync_macos_dock_visibility path that already handles policy when all panel guards are released. Removing it eliminates the harmful rapid toggling with no observable regression risk.
No files require special attention.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(macos): remove redundant activation ..." | Re-trigger Greptile