Bring fullscreen media viewer to active space on macOS.

This commit is contained in:
John Preston
2026-04-09 17:06:44 +07:00
parent 61f89d7b33
commit d0e24b555c
2 changed files with 13 additions and 1 deletions
@@ -93,6 +93,18 @@ void MacOverlayWidgetHelper::updateStyles(bool fullscreen) {
? NSNormalWindowLevel
: NSPopUpMenuWindowLevel;
[window setLevel:level];
// Fullscreen overlay: follow the currently active Space on activation.
// Windowed overlay: behave like a normal tool panel, so the user can move
// it to another desktop and it stays there.
auto behavior = [window collectionBehavior];
if (fullscreen) {
behavior |= NSWindowCollectionBehaviorMoveToActiveSpace;
} else {
behavior &= ~NSWindowCollectionBehaviorMoveToActiveSpace;
}
[window setCollectionBehavior:behavior];
[window setHidesOnDeactivate:!_data->window->testAttribute(Qt::WA_MacAlwaysShowToolWindow)];
[window setTitleVisibility:NSWindowTitleHidden];
[window setTitlebarAppearsTransparent:YES];