Skip to content

fix(main): keep the Dock icon when toggling visibleOnAllWorkspaces on macOS#27

Open
codebytere-ant wants to merge 1 commit into
loc:mainfrom
codebytere-ant:fix/dock-icon-visible-on-all-workspaces
Open

fix(main): keep the Dock icon when toggling visibleOnAllWorkspaces on macOS#27
codebytere-ant wants to merge 1 commit into
loc:mainfrom
codebytere-ant:fix/dock-icon-visible-on-all-workspaces

Conversation

@codebytere-ant

Copy link
Copy Markdown
Contributor

Electron implements a truthy visibleOnFullScreen by transforming the app into a UIElement, which removes its Dock icon and Cmd+Tab entry. The visibleOnAllWorkspaces prop setter passed visibleOnFullScreen: true on 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: true on every setVisibleOnAllWorkspaces call (both the prop setter and applyPostCreationProps) and lets visibleOnFullScreen follow 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.

… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant