[vlc-commits] [Git][videolan/vlc][master] macosx: fix slider clipping during live resize

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jul 23 13:31:32 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
48eaa3f8 by Serhii Bykov at 2026-07-23T13:06:59+00:00
macosx: fix slider clipping during live resize

- - - - -


3 changed files:

- modules/gui/macosx/main/CompatibilityFixes.h
- modules/gui/macosx/views/VLCPlaybackProgressSlider.m
- modules/gui/macosx/views/VLCVolumeSlider.m


Changes:

=====================================
modules/gui/macosx/main/CompatibilityFixes.h
=====================================
@@ -48,6 +48,16 @@ enum {
 
 #endif
 
+#ifndef MAC_OS_VERSION_14_0
+
+ at interface NSView (VLCCompatibility)
+
+ at property BOOL clipsToBounds;
+
+ at end
+
+#endif
+
 NS_ASSUME_NONNULL_END
 
 #define OSX_BIGSUR_AND_HIGHER (NSAppKitVersionNumber >= 2022.00)


=====================================
modules/gui/macosx/views/VLCPlaybackProgressSlider.m
=====================================
@@ -24,6 +24,7 @@
 
 #import "extensions/NSString+Helpers.h"
 #import "extensions/NSView+VLCAdditions.h"
+#import "main/CompatibilityFixes.h"
 #import "views/VLCPlaybackProgressSliderCell.h"
 
 @implementation VLCPlaybackProgressSlider {
@@ -47,17 +48,7 @@
         self.scrollable = YES;
         if (@available(macOS 10.14, *)) {
             [self viewDidChangeEffectiveAppearance];
-
-            if (@available(macOS 13, *)) {
-                // Apple's documentation says the clipping default changed in macOS 13.
-                // Use a dynamic call so this still builds with SDKs that don't declare the selector.
-                SEL clipsToBoundsSelector = NSSelectorFromString(@"setClipsToBounds:");
-                if ([self respondsToSelector:clipsToBoundsSelector]) {
-                    void (*setClipsToBoundsImp)(id, SEL, BOOL) =
-                        (void (*)(id, SEL, BOOL))[self methodForSelector:clipsToBoundsSelector];
-                    setClipsToBoundsImp(self, clipsToBoundsSelector, YES);
-                }
-            }
+            self.clipsToBounds = YES;
         } else {
             [(VLCPlaybackProgressSliderCell*)self.cell setSliderStyleLight];
         }


=====================================
modules/gui/macosx/views/VLCVolumeSlider.m
=====================================
@@ -23,6 +23,7 @@
 #import "VLCVolumeSlider.h"
 
 #import "extensions/NSView+VLCAdditions.h"
+#import "main/CompatibilityFixes.h"
 #import "views/VLCVolumeSliderCell.h"
 
 @implementation VLCVolumeSlider
@@ -37,6 +38,7 @@
 
         if (@available(macOS 10.14, *)) {
             [self viewDidChangeEffectiveAppearance];
+            self.clipsToBounds = YES;
         } else {
             [(VLCVolumeSliderCell*)self.cell setSliderStyleLight];
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/48eaa3f898b3fde21ddad318a0c89d6f6bb94eff

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/48eaa3f898b3fde21ddad318a0c89d6f6bb94eff
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