Revision: 15969
          http://sourceforge.net/p/skim-app/code/15969
Author:   hofman
Date:     2026-01-07 15:29:22 +0000 (Wed, 07 Jan 2026)
Log Message:
-----------
rename ivar, check macOS version when setting

Modified Paths:
--------------
    trunk/SKPDFView.h
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2026-01-06 18:45:15 UTC (rev 15968)
+++ trunk/SKPDFView.h   2026-01-07 15:29:22 UTC (rev 15969)
@@ -171,7 +171,7 @@
     
     NSInteger spellingTag;
     
-    _Atomic(BOOL) inKeyWindow;
+    _Atomic(BOOL) drawsActiveSelection;
     
     BOOL hideNotes;
     BOOL wantsNewUndoGroup;

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-01-06 18:45:15 UTC (rev 15968)
+++ trunk/SKPDFView.m   2026-01-07 15:29:22 UTC (rev 15969)
@@ -274,8 +274,12 @@
     
     hideNotes = NO;
     wantsNewUndoGroup = NO;
-    inKeyWindow = NO;
     
+    if (@available(macOS 15.0, *))
+        drawsActiveSelection = NO;
+    else
+        drawsActiveSelection = YES;
+    
     readingBar = nil;
     
     pacerTimer = nil;
@@ -414,10 +418,7 @@
 #pragma mark Drawing
 
 - (BOOL)drawsActiveSelections {
-    if (@available(macOS 10.15, *))
-        return atomic_load(&inKeyWindow);
-    else
-        return YES;
+    return atomic_load(&drawsActiveSelection);
 }
 
 - (CGFloat)unitWidthOnPage:(PDFPage *)page {
@@ -3164,8 +3165,8 @@
 }
 
 - (void)handleKeyStateChangedNotification:(NSNotification *)notification {
-    atomic_store(&inKeyWindow, [[self window] isKeyWindow]);
     if (@available(macOS 10.15, *)) {
+        atomic_store(&drawsActiveSelection, [[self window] isKeyWindow]);
         if (selectionPageIndex != NSNotFound) {
             CGFloat margin = HANDLE_SIZE / [self scaleFactor];
             for (PDFPage *page in [self displayedPages])
@@ -3208,7 +3209,8 @@
         [nc removeObserver:self name:NSWindowDidResignMainNotification 
object:oldWindow];
     }
     if (newWindow) {
-        atomic_store(&inKeyWindow, [newWindow isKeyWindow]);
+        if (@available(macOS 15.0, *))
+            atomic_store(&drawsActiveSelection, [newWindow isKeyWindow]);
         [nc addObserver:self 
selector:@selector(handleKeyStateChangedNotification:) 
name:NSWindowDidBecomeKeyNotification object:newWindow];
         [nc addObserver:self 
selector:@selector(handleKeyStateChangedNotification:) 
name:NSWindowDidResignKeyNotification object:newWindow];
         [nc addObserver:self 
selector:@selector(handleMainStateChangedNotification:) 
name:NSWindowDidResignMainNotification object:newWindow];

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