feat: reinvigorate visibleOnFullscreen option (#24956)
This commit is contained in:
parent
52d7afa4ef
commit
53668445ba
8 changed files with 37 additions and 9 deletions
|
@ -1351,8 +1351,24 @@ void NativeWindowMac::SetProgressBar(double progress,
|
|||
void NativeWindowMac::SetOverlayIcon(const gfx::Image& overlay,
|
||||
const std::string& description) {}
|
||||
|
||||
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) {
|
||||
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible,
|
||||
bool visibleOnFullScreen) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
SetCollectionBehavior(visible, NSWindowCollectionBehaviorCanJoinAllSpaces);
|
||||
SetCollectionBehavior(visibleOnFullScreen,
|
||||
NSWindowCollectionBehaviorFullScreenAuxiliary);
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue