Revision: 15167
          http://sourceforge.net/p/skim-app/code/15167
Author:   hofman
Date:     2025-05-07 16:02:04 +0000 (Wed, 07 May 2025)
Log Message:
-----------
Draw initial snapshot thumbnail with lower priority when opening from setup

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

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2025-05-07 15:47:14 UTC (rev 15166)
+++ trunk/SKMainWindowController.h      2025-05-07 16:02:04 UTC (rev 15167)
@@ -318,7 +318,7 @@
 - (void)allThumbnailsNeedUpdate;
 
 - (void)resetSnapshotSizeIfNeeded;
-- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)dirstySnapshot 
placeholder:(BOOL)isPlaceholder;
+- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)dirstySnapshot 
lowPriority:(BOOL)lowPriority;
 - (void)allSnapshotsNeedUpdate;
 
 - (void)setPdfDocument:(nullable PDFDocument *)pdfDocument 
addAnnotationsFromDictionaries:(nullable NSArray<NSDictionary<NSString *, id> 
*> *)noteDicts;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-05-07 15:47:14 UTC (rev 15166)
+++ trunk/SKMainWindowController.m      2025-05-07 16:02:04 UTC (rev 15167)
@@ -2140,7 +2140,7 @@
         NSUInteger idx = [page pageIndex];
         for (SKSnapshotWindowController *wc in snapshots) {
             if ([wc isPageVisible:page]) {
-                [self snapshotNeedsUpdate:wc placeholder:NO];
+                [self snapshotNeedsUpdate:wc lowPriority:NO];
                 [[wc pdfView] setNeedsDisplay:YES];
             }
         }
@@ -2212,7 +2212,7 @@
             [self updateThumbnailAtPageIndex:[page pageIndex]];
             for (SKSnapshotWindowController *wc in snapshots) {
                 if ([wc isPageVisible:page])
-                    [self snapshotNeedsUpdate:wc placeholder:NO];
+                    [self snapshotNeedsUpdate:wc lowPriority:NO];
             }
             [secondaryPdfView addedAnnotation:annotation onPage:page];
             if ([self interactionMode] == SKPresentationMode && 
[presentationView page] == page)
@@ -2257,7 +2257,7 @@
             [self updateThumbnailAtPageIndex:[page pageIndex]];
             for (SKSnapshotWindowController *wc in snapshots) {
                 if ([wc isPageVisible:page])
-                    [self snapshotNeedsUpdate:wc placeholder:NO];
+                    [self snapshotNeedsUpdate:wc lowPriority:NO];
             }
             [secondaryPdfView removedAnnotation:annotation onPage:page];
             if ([self interactionMode] == SKPresentationMode && 
[presentationView page] == page)
@@ -2281,7 +2281,7 @@
             [self updateThumbnailAtPageIndex:[newPage pageIndex]];
         for (SKSnapshotWindowController *wc in snapshots) {
             if ([wc isPageVisible:oldPage] || [wc isPageVisible:newPage])
-                [self snapshotNeedsUpdate:wc placeholder:NO];
+                [self snapshotNeedsUpdate:wc lowPriority:NO];
         }
         [secondaryPdfView removedAnnotation:annotation onPage:oldPage];
         [secondaryPdfView addedAnnotation:annotation onPage:newPage];
@@ -2362,7 +2362,7 @@
     
     NSImage *image = [controller 
placeholderThumbnailWithSize:snapshotCacheSize scale:[[self window] 
backingScaleFactor]];
     [controller setThumbnail:image];
-    [self snapshotNeedsUpdate:controller placeholder:YES];
+    [self snapshotNeedsUpdate:controller lowPriority:openType == 
SKSnapshotOpenFromSetup];
     
     if (openType == SKSnapshotOpenFromSetup) {
         [self insertObject:controller inSnapshotsAtIndex:[snapshots count]];
@@ -2404,7 +2404,7 @@
 
 - (void)snapshotControllerDidChange:(SKSnapshotWindowController *)controller {
     if (controller != presentationPreview) {
-        [self snapshotNeedsUpdate:controller placeholder:NO];
+        [self snapshotNeedsUpdate:controller lowPriority:NO];
         [rightSideController.snapshotArrayController rearrangeObjects];
         [rightSideController.snapshotTableView reloadData];
         [[self document] setRecentInfoNeedsUpdate:YES];
@@ -2719,7 +2719,7 @@
                 
                 for (SKSnapshotWindowController *wc in snapshots) {
                     if ([wc isPageVisible:page]) {
-                        [self snapshotNeedsUpdate:wc placeholder:NO];
+                        [self snapshotNeedsUpdate:wc lowPriority:NO];
                         [[wc pdfView] updatedAnnotation:note];
                     }
                 }
@@ -3068,7 +3068,7 @@
     }
 }
 
-- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)controller 
placeholder:(BOOL)isPlaceholder {
+- (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)controller 
lowPriority:(BOOL)lowPriority {
     CGFloat backingScale = [[self window] backingScaleFactor];
     SKSnapshotConfiguration *configuration = [controller currentConfiguration];
     NSDate *date = [NSDate date];
@@ -3076,7 +3076,7 @@
     
     if ([rightSideController.snapshotTableView window] == nil)
         queue = [[self class] backgroundThumbnailQueue];
-    else if (isPlaceholder)
+    else if (lowPriority)
         queue = [[self class] thumbnailQueue];
     else
         queue = [[self class] utilityThumbnailQueue];
@@ -3107,7 +3107,7 @@
 
 - (void)allSnapshotsNeedUpdate {
     for (SKSnapshotWindowController *controller in [self snapshots])
-        [self snapshotNeedsUpdate:controller placeholder:NO];
+        [self snapshotNeedsUpdate:controller lowPriority:NO];
     
 }
 

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to