Revision: 16709
          http://sourceforge.net/p/skim-app/code/16709
Author:   hofman
Date:     2026-10-24 22:44:10 +0000 (Sat, 24 Oct 2026)
Log Message:
-----------
call presentation notes setup methods only when having a notes document. Get 
its screen in caller method.

Modified Paths:
--------------
    trunk/SKMainWindowController_FullScreen.m

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2026-10-24 21:57:21 UTC (rev 
16708)
+++ trunk/SKMainWindowController_FullScreen.m   2026-10-24 22:44:10 UTC (rev 
16709)
@@ -181,11 +181,8 @@
     return mainScreen;
 }
 
-- (void)showNotesForPresentationScreen:(NSScreen *)presentationScreen {
+- (void)showNotesForPresentationOnScreen:(NSScreen *)screen {
     NSDocument *notesDocument = [self presentationNotesDocument];
-    if (notesDocument == nil)
-        return;
-    
     PDFDocument *pdfDoc = [notesDocument pdfDocument];
     NSInteger offset = [self presentationNotesOffset];
     NSUInteger pageIndex = MAX(0, MIN((NSInteger)[pdfDoc pageCount], 
(NSInteger)[[pdfView currentPage] pageIndex] + offset));
@@ -200,7 +197,6 @@
         
         [preview setDelegate:self];
         
-        NSScreen *screen = [self 
screenForPresentationWindowAvoidingScreen:presentationScreen preferExternal:NO];
         [preview setPdfDocument:[pdfView document] previewPageNumber:pageIndex 
displayOnScreen:screen];
     
         [[self document] addWindowController:preview];
@@ -284,11 +280,10 @@
     
     interactionMode = SKPresentationMode;
     
-    NSScreen *screen = nil;
+    NSDocument *notesDocument = [self presentationNotesDocument];
+    NSScreen *notesScreen = (notesDocument && notesDocument != [self 
document]) ? [[notesDocument primaryWindow] screen] : nil;
     BOOL preferExternal = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKPreferExternalDisplayForPresentationKey];
-    if ([self presentationNotesDocument] && [self presentationNotesDocument] 
!= [self document])
-        screen = [[[self presentationNotesDocument] primaryWindow] screen];
-    screen = [self screenForPresentationWindowAvoidingScreen:screen 
preferExternal:preferExternal];
+    NSScreen *screen = [self 
screenForPresentationWindowAvoidingScreen:notesScreen 
preferExternal:preferExternal];
     
     NSWindow *presentationWindow = [[SKFullScreenWindow alloc] 
initWithContentRect:[screen frame]];
     [presentationWindow setAlphaValue:0.0];
@@ -305,7 +300,11 @@
     
     [presentationWindow orderFront:nil];
     
-    [self showNotesForPresentationScreen:screen];
+    if (notesDocument) {
+        if (notesScreen == nil)
+            notesScreen = [self 
screenForPresentationWindowAvoidingScreen:screen preferExternal:NO];
+        [self showNotesForPresentationOnScreen:notesScreen];
+    }
     
     BOOL shouldFadeOut = NO;
     if ([[normalWindow tabbedWindows] count] > 1) {
@@ -354,7 +353,8 @@
             
             [presentationView didOpen];
             
-            [self addPresentationNotesNavigation];
+            if (notesDocument)
+                [self addPresentationNotesNavigation];
             
             mwcFlags.isSwitchingFullScreen = 0;
         }];

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