Revision: 16054
          http://sourceforge.net/p/skim-app/code/16054
Author:   hofman
Date:     2026-02-27 15:20:03 +0000 (Fri, 27 Feb 2026)
Log Message:
-----------
Enforce overlay scrollers on Tahoe, as it has ascrolling bug with legacy 
scrollers, scrolling up by the scroller width at many mouse and scroll events.

Modified Paths:
--------------
    trunk/NSScroller_SKExtensions.m
    trunk/SKBasePDFView.m

Modified: trunk/NSScroller_SKExtensions.m
===================================================================
--- trunk/NSScroller_SKExtensions.m     2026-02-10 23:02:43 UTC (rev 16053)
+++ trunk/NSScroller_SKExtensions.m     2026-02-27 15:20:03 UTC (rev 16054)
@@ -41,9 +41,9 @@
 @implementation NSScroller (SKExtensions)
 
 + (CGFloat)effectiveScrollerWidth {
-    if ([self preferredScrollerStyle] != NSScrollerStyleLegacy)
-        return 0.0;
-    return [self scrollerWidthForControlSize:NSControlSizeRegular 
scrollerStyle:NSScrollerStyleLegacy];
+    if (@available(macOS 26.0, *)) {} else if ([self preferredScrollerStyle] 
== NSScrollerStyleLegacy)
+        return [self scrollerWidthForControlSize:NSControlSizeRegular 
scrollerStyle:NSScrollerStyleLegacy];
+    return 0.0;
 }
 
 @end

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2026-02-10 23:02:43 UTC (rev 16053)
+++ trunk/SKBasePDFView.m       2026-02-27 15:20:03 UTC (rev 16054)
@@ -81,21 +81,21 @@
 - (void)commonBaseInitialization {
     minHistoryIndex = 0;
     
+    NSScrollView *scrollView = [self embeddedScrollView];
+    
     if (@available(macOS 10.14, *)) {
         [self setAppearance:nil];
-        [[[self embeddedScrollView] contentView] setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
+        [[scrollView contentView] setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
         if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKInvertColorsInDarkModeKey])
-            [[self embeddedScrollView] setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
+            [scrollView setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
         
-        if (@available(macOS 11.0, *)) {} else {
-            [self handleScrollerStyleChangedNotification:nil];
-            
-            [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleScrollerStyleChangedNotification:)
-                                                             
name:NSPreferredScrollerStyleDidChangeNotification object:nil];
-        }
+        [self handleScrollerStyleChangedNotification:nil];
+        
+        [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleScrollerStyleChangedNotification:)
+                                                         
name:NSPreferredScrollerStyleDidChangeNotification object:nil];
     }
     
-    [[self embeddedScrollView] setContentFilters:SKColorEffectFilters()];
+    [scrollView setContentFilters:SKColorEffectFilters()];
     
     NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
     for (NSString *key in defaultKeysToObserve())
@@ -134,13 +134,14 @@
 }
 
 - (void)colorFiltersDidChange {
+    NSScrollView *scrollView = [self embeddedScrollView];
     if (@available(macOS 10.14, *)) {
         if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKInvertColorsInDarkModeKey])
-            [[self embeddedScrollView] setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
+            [scrollView setAppearance:[NSAppearance 
appearanceNamed:NSAppearanceNameAqua]];
         else
-            [[self embeddedScrollView] setAppearance:nil];
+            [scrollView setAppearance:nil];
     }
-    [[self embeddedScrollView] setContentFilters:SKColorEffectFilters()];
+    [scrollView setContentFilters:SKColorEffectFilters()];
 }
 
 - (void)viewDidChangeEffectiveAppearance {
@@ -151,12 +152,15 @@
 }
 
 - (void)handleScrollerStyleChangedNotification:(NSNotification *)notification {
-    if (@available(macOS 10.14, *)) {
+    if (@available(macOS 26.0, *)) {
+        [[self embeddedScrollView] setScrollerStyle:NSScrollerStyleOverlay];
+    } else if (@available(macOS 11.0, *)) {} else if (@available(macOS 10.14, 
*)) {
         NSAppearance *appearance = nil;
         if ([NSScroller preferredScrollerStyle] != NSScrollerStyleLegacy)
             appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
-        [[[self embeddedScrollView] verticalScroller] 
setAppearance:appearance];
-        [[[self embeddedScrollView] horizontalScroller] 
setAppearance:appearance];
+        NSScrollView *scrollView = [self embeddedScrollView];
+        [[scrollView verticalScroller] setAppearance:appearance];
+        [[scrollView horizontalScroller] setAppearance:appearance];
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to