feat: add option to not transform processes on win.SetVisibleOnAllWorkspaces (#27200)
* fix: optionally transform processes on win.SetVisibleOnAllWorkspaces on macOS, making it backwards-compatible with v9.2.1 (#27101) * fix: optionally transform processes on win.SetVisibleOnAllWorkspaces on macOS, making it backwards-compatible with v9.2.1 (#27101) Co-authored-by: Cyrus Roshan <cyrusroshan@users.noreply.github.com>
This commit is contained in:
parent
272611cc82
commit
444ad26f89
7 changed files with 36 additions and 16 deletions
|
@ -1161,18 +1161,21 @@ void NativeWindowMac::SetOverlayIcon(const gfx::Image& overlay,
|
|||
const std::string& description) {}
|
||||
|
||||
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible,
|
||||
bool visibleOnFullScreen) {
|
||||
bool visibleOnFullScreen,
|
||||
bool skipTransformProcessType) {
|
||||
// In order for NSWindows to be visible on fullscreen we need to functionally
|
||||
// mimic app.dock.hide() since Apple changed the underlying functionality of
|
||||
// NSWindows starting with 10.14 to disallow NSWindows from floating on top of
|
||||
// fullscreen apps.
|
||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
||||
if (visibleOnFullScreen) {
|
||||
[window_ setCanHide:NO];
|
||||
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
|
||||
} else {
|
||||
[window_ setCanHide:YES];
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
if (!skipTransformProcessType) {
|
||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
||||
if (visibleOnFullScreen) {
|
||||
[window_ setCanHide:NO];
|
||||
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
|
||||
} else {
|
||||
[window_ setCanHide:YES];
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
}
|
||||
}
|
||||
|
||||
SetCollectionBehavior(visible, NSWindowCollectionBehaviorCanJoinAllSpaces);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue