[vlc-commits] [Git][videolan/vlc][master] macosx/vout provider: fix dock icon during float-on-top in spaces

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri May 22 17:26:38 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
48091b68 by Felix Paul Kühne at 2026-05-22T19:15:43+02:00
macosx/vout provider: fix dock icon during float-on-top in spaces

Use NSWindowCollectionBehaviorCanJoinAllSpaces on macOS 13 and later so
the app icon remains visible.

Fixes #29250

- - - - -


2 changed files:

- modules/gui/macosx/main/CompatibilityFixes.h
- modules/gui/macosx/windows/video/VLCVideoOutputProvider.m


Changes:

=====================================
modules/gui/macosx/main/CompatibilityFixes.h
=====================================
@@ -40,6 +40,14 @@ extern NSString *const NSCollectionViewSupplementaryElementKind;
 
 #endif
 
+#ifndef MAC_OS_VERSION_13_0
+
+enum {
+    NSWindowCollectionBehaviorCanJoinAllApplications = 1 << 18,
+};
+
+#endif
+
 NS_ASSUME_NONNULL_END
 
 #define OSX_BIGSUR_AND_HIGHER (NSAppKitVersionNumber >= 2022.00)


=====================================
modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
=====================================
@@ -610,20 +610,35 @@ static int WindowFloatOnTop(vlc_object_t *obj,
         _statusLevelWindowCounter++;
         // window level need to stay on normal in fullscreen mode
         if (!o_window.fullscreen && !o_window.inFullscreenTransition) {
-            // make sure float on top can join all spaces, including full-screen ones
-            NSApp.activationPolicy = NSApplicationActivationPolicyAccessory;
             [self updateWindowLevelForHelperWindows:i_level];
-            o_window.collectionBehavior = NSWindowCollectionBehaviorCanJoinAllSpaces |
-                                          NSWindowCollectionBehaviorIgnoresCycle |
-                                          NSWindowCollectionBehaviorTransient |
-                                          NSWindowCollectionBehaviorFullScreenAuxiliary;
+
+            // make sure float on top can join all spaces, including full-screen ones
+            NSWindowCollectionBehavior behavior =
+                NSWindowCollectionBehaviorCanJoinAllSpaces |
+                NSWindowCollectionBehaviorIgnoresCycle |
+                NSWindowCollectionBehaviorTransient |
+                NSWindowCollectionBehaviorFullScreenAuxiliary;
+
+            if (@available(macOS 13.0, *)) {
+                behavior |= NSWindowCollectionBehaviorCanJoinAllApplications;
+            } else {
+                // Pre-Ventura: accessory policy is the only way to float over
+                // other apps' full-screen Spaces. Dock tile disappears as a
+                // side effect. #29250
+                NSApp.activationPolicy = NSApplicationActivationPolicyAccessory;
+            }
+            o_window.collectionBehavior = behavior;
         }
     } else {
         if (_statusLevelWindowCounter > 0) {
             _statusLevelWindowCounter--;
-        } 
+        }
         if (_statusLevelWindowCounter == 0) {
-            NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
+            if (@available(macOS 13.0, *)) {
+                // NO-OP. Intentionally empty as negating @available is unsupported in ObjC
+            } else {
+                NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
+            }
             [self updateWindowLevelForHelperWindows:i_level];
         }
         o_window.collectionBehavior = NSWindowCollectionBehaviorDefault;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/48091b683eaa1550d3d05a5aaff907fa5528f8c0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/48091b683eaa1550d3d05a5aaff907fa5528f8c0
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list