From 58650a2a2f221837b3a86436b4c3f36ccfb4a6fa Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Sun, 7 Apr 2024 18:19:44 +0800 Subject: [PATCH] macosx: Toggle app activation policy to allow window to join fullscreen spaces Signed-off-by: Claudio Cambra --- .../gui/macosx/windows/video/VLCVideoOutputProvider.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m index 9d35db5f68..17a94456c1 100644 --- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m +++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m @@ -522,13 +522,14 @@ int WindowOpen(vlc_window_t *p_wnd) if(i_level == NSStatusWindowLevel) { _statusLevelWindowCounter++; // window level need to stay on normal in fullscreen mode - if (![o_window fullscreen] && ![o_window inFullscreenTransition]) + if (![o_window fullscreen] && ![o_window inFullscreenTransition]) { [self updateWindowLevelForHelperWindows:i_level]; + } } else { - if (_statusLevelWindowCounter > 0) + if (_statusLevelWindowCounter > 0) { _statusLevelWindowCounter--; - - if (_statusLevelWindowCounter == 0) { + } else if (_statusLevelWindowCounter == 0) { + NSApp.activationPolicy = NSApplicationActivationPolicyRegular; [self updateWindowLevelForHelperWindows:i_level]; } } @@ -546,6 +547,7 @@ int WindowOpen(vlc_window_t *p_wnd) return; } + NSApp.activationPolicy = NSApplicationActivationPolicyAccessory; [self setWindowLevel:NSStatusWindowLevel forWindow:p_wnd]; window.collectionBehavior = NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorIgnoresCycle |