feature(macos): show dock icon when config window is open#4628
Open
Mitnitsky wants to merge 1 commit intoflameshot-org:masterfrom
Open
feature(macos): show dock icon when config window is open#4628Mitnitsky wants to merge 1 commit intoflameshot-org:masterfrom
Mitnitsky wants to merge 1 commit intoflameshot-org:masterfrom
Conversation
Collaborator
|
Thanks for the very informative link explaining the problem and fix. However this only fixes the config window and not any other window that is spawned. Is there a way to abstract this so other widgets can add a one-liner and get this feature? |
4d0b3a8 to
38fa920
Compare
On macOS with LSUIElement=true, Flameshot runs as an agent app (no dock icon). This adds a dock icon that appears while any user-facing window (Settings, About, Launcher, Upload History) is visible and disappears when the last one is closed or hidden. Uses QWindow::visibilityChanged signal with a per-window dynamic property to track visibility state and a reference counter for the activation policy toggle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
38fa920 to
c79d5af
Compare
Contributor
Author
I've added those changes :) |
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
On macOS with
LSUIElement=true, Flameshot runs as an agent app with no dock icon. This makes it impossible to Cmd+Tab to open windows or see the app in the dock.This PR adds a dock icon that appears while any user-facing window is visible and disappears when the last one is closed or hidden.
Supported windows
Implementation
Flameshot::showDockIcon(QWidget*)— public one-liner for any window. Call aftershow().QWindow::visibilityChangedsignal to track window visibility._visibleInDock) prevents double-counting on minimize/maximize transitions.NSApplicationActivationPolicybetween Regular (dock icon) and Accessory (no dock icon).showDockIcon(myWidget).Testing
Tested on macOS 26.4 (Tahoe), Apple Silicon, Qt 6.11.0: