fix(main): keep the Dock icon when toggling visibleOnAllWorkspaces on macOS#27
Open
codebytere-ant wants to merge 1 commit into
Open
Conversation
… macOS Electron implements a truthy visibleOnFullScreen by transforming the app into a UIElement, which removes its Dock icon and Cmd+Tab entry - and the visibleOnAllWorkspaces setter passed visibleOnFullScreen: true on every call, including the disable one a window pool sends when it releases a window. The first release of a pooled window that ever had the prop set silently stripped the host app from the Dock while its other windows kept running. Always pass skipTransformProcessType and let visibleOnFullScreen follow the enable flag: the window still joins every Space and the app's own fullscreen Spaces via collection behaviors, and the app's activation policy is never touched. The tradeoff, now documented in the props guide, is that a regular (Dock-visible) app cannot float a window over another app's fullscreen Space; apps that need that should hide their Dock icon explicitly rather than have a window prop do it as a side effect. Co-authored-by: Andy Locascio <1815863+loc@users.noreply.github.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.
Electron implements a truthy
visibleOnFullScreenby transforming the app into a UIElement, which removes its Dock icon and Cmd+Tab entry. ThevisibleOnAllWorkspacesprop setter passedvisibleOnFullScreen: trueon every call - including the disable one a pool sends when it releases a window - so the first release of a pooled window that ever carried the prop silently stripped the host app from the Dock while its other windows kept running, and nothing put it back.This passes
skipTransformProcessType: trueon everysetVisibleOnAllWorkspacescall (both the prop setter andapplyPostCreationProps) and letsvisibleOnFullScreenfollow the enable flag. The window still joins every Space and the app's own fullscreen Spaces through collection behaviors, and the app's activation policy is never touched by a window prop. The tradeoff, called out in the props guide: a regular Dock-visible app can't float a window over another app's fullscreen Space on modern macOS without that transform, so an app that wants overlay-everything behavior should hide its Dock icon deliberately (app.dock.hide()) instead of getting it as a side effect. Unit tests cover the enable, disable, and post-creation paths on the darwin branch.This is your fix - you shipped it downstream as a package patch in May and it has been running there since; landing it in the library (you're co-author on the commit) is what lets us delete that patch at the next version bump.