Revision: 15560
          http://sourceforge.net/p/skim-app/code/15560
Author:   hofman
Date:     2025-06-29 14:35:24 +0000 (Sun, 29 Jun 2025)
Log Message:
-----------
rename mainWindow property to primaryWindow to avoid confusion with NSApp's 
mainWindow

Modified Paths:
--------------
    trunk/NSDocument_SKExtensions.h
    trunk/NSDocument_SKExtensions.m
    trunk/SKDocumentController.m
    trunk/SKMainDocument.m
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKNotesDocument.m

Modified: trunk/NSDocument_SKExtensions.h
===================================================================
--- trunk/NSDocument_SKExtensions.h     2025-06-28 17:00:08 UTC (rev 15559)
+++ trunk/NSDocument_SKExtensions.h     2025-06-29 14:35:24 UTC (rev 15560)
@@ -54,7 +54,7 @@
 
 + (BOOL)isPDFDocument;
 
-@property (nonatomic, nullable, readonly) NSWindow *mainWindow;
+@property (nonatomic, nullable, readonly) NSWindow *primaryWindow;
 
 - (IBAction)copyURL:(nullable id)sender;
 

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2025-06-28 17:00:08 UTC (rev 15559)
+++ trunk/NSDocument_SKExtensions.m     2025-06-29 14:35:24 UTC (rev 15560)
@@ -67,7 +67,7 @@
 
 + (BOOL)isPDFDocument { return NO; }
 
-- (NSWindow *)mainWindow {
+- (NSWindow *)primaryWindow {
     return [[[self windowControllers] firstObject] window];
 }
 
@@ -92,12 +92,12 @@
 - (NSMenu *)notesMenu { return nil; }
 
 - (SKInteractionMode)interactionMode  {
-    return ([[self mainWindow] styleMask] & NSWindowStyleMaskFullScreen) == 0 
? SKNormalMode : SKFullScreenMode;
+    return ([[self primaryWindow] styleMask] & NSWindowStyleMaskFullScreen) == 
0 ? SKNormalMode : SKFullScreenMode;
 }
 
 - (void)setInteractionMode:(SKInteractionMode)mode {
     if (mode != [self interactionMode] && (mode == SKFullScreenMode || mode == 
SKNormalMode))
-        [[self mainWindow] toggleFullScreen:nil];
+        [[self primaryWindow] toggleFullScreen:nil];
 }
 
 - (BOOL)canExitPresentation { return NO; }
@@ -134,12 +134,12 @@
             [setup setObject:data forKey:[alias isBookmark] ? 
SKDocumentSetupBookmarkKey : SKDocumentSetupAliasKey];
     }
     
-    NSWindow *window = [self mainWindow];
+    NSWindow *window = [self primaryWindow];
     if (window)
         [setup setObject:NSStringFromRect([window frame]) 
forKey:SKDocumentSetupWindowFrameKey];
     
-    NSArray *windows = [[NSApp orderedDocuments] valueForKey:@"mainWindow"];
-    NSString *tabs = [[self mainWindow] tabIndexesInWindows:windows];
+    NSArray *windows = [[NSApp orderedDocuments] valueForKey:@"primaryWindow"];
+    NSString *tabs = [[self primaryWindow] tabIndexesInWindows:windows];
     if (tabs)
         [setup setObject:tabs forKey:SKDocumentSetupTabsKey];
     

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2025-06-28 17:00:08 UTC (rev 15559)
+++ trunk/SKDocumentController.m        2025-06-29 14:35:24 UTC (rev 15560)
@@ -381,8 +381,8 @@
                 }
                 
                 [self openDocumentWithBookmark:child 
completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError 
*error){
-                    if (windows && [document mainWindow])
-                        [windows replaceObjectAtIndex:i withObject:[document 
mainWindow]];
+                    if (windows && [document primaryWindow])
+                        [windows replaceObjectAtIndex:i withObject:[document 
primaryWindow]];
                     if (document == nil && error) {
                         if (errors == nil)
                             errors = [[NSMutableArray alloc] init];

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2025-06-28 17:00:08 UTC (rev 15559)
+++ trunk/SKMainDocument.m      2025-06-29 14:35:24 UTC (rev 15560)
@@ -1015,11 +1015,11 @@
 }
 
 - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName 
error:(NSError **)outError{
-    NSWindow *mainWindow = [[self mainWindowController] window];
+    NSWindow *primaryWindow = [[self mainWindowController] window];
     NSWindow *modalwindow = nil;
     NSModalSession session;
     
-    if ([mainWindow attachedSheet] == nil && [mainWindow isMainWindow]) {
+    if ([primaryWindow attachedSheet] == nil && [primaryWindow isMainWindow]) {
         modalwindow = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:NSZeroRect];
         [(SKApplication *)NSApp setUserAttentionDisabled:YES];
         session = [NSApp beginModalSessionForWindow:modalwindow];
@@ -1597,7 +1597,7 @@
 
 #pragma mark Accessors
 
-- (NSWindow *)mainWindow {
+- (NSWindow *)primaryWindow {
     return [mainWindowController window];
 }
 

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2025-06-28 17:00:08 UTC (rev 
15559)
+++ trunk/SKMainWindowController_FullScreen.m   2025-06-29 14:35:24 UTC (rev 
15560)
@@ -242,7 +242,7 @@
     
     NSScreen *screen = [normalWindow screen];
     if ([self presentationNotesDocument] && [self presentationNotesDocument] 
!= [self document]) {
-        NSArray *screens = [[[[self presentationNotesDocument] mainWindow] 
screen] alternateScreens];
+        NSArray *screens = [[[[self presentationNotesDocument] primaryWindow] 
screen] alternateScreens];
         if ([screens count] > 0 && [screens containsObject:[screen 
primaryScreen]] == NO)
             screen = [screens firstObject];
     }

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2025-06-28 17:00:08 UTC (rev 15559)
+++ trunk/SKNotesDocument.m     2025-06-29 14:35:24 UTC (rev 15560)
@@ -596,12 +596,12 @@
 }
 
 - (IBAction)toggleFullscreen:(id)sender {
-    [[self mainWindow] toggleFullScreen:sender];
+    [[self primaryWindow] toggleFullScreen:sender];
 }
 
 - (void)performFindPanelAction:(id)sender {
     if ([sender tag] == NSFindPanelActionShowFindPanel) {
-        NSToolbar *toolbar = [[self mainWindow] toolbar];
+        NSToolbar *toolbar = [[self primaryWindow] toolbar];
         if ([[[toolbar items] valueForKey:@"itemIdentifier"] 
containsObject:SKNotesDocumentSearchToolbarItemIdentifier] == NO)
             [toolbar 
insertItemWithItemIdentifier:SKNotesDocumentSearchToolbarItemIdentifier 
atIndex:0];
         if ([toolbar displayMode] == NSToolbarDisplayModeLabelOnly)

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