Revision: 15345
          http://sourceforge.net/p/skim-app/code/15345
Author:   hofman
Date:     2025-06-02 09:35:57 +0000 (Mon, 02 Jun 2025)
Log Message:
-----------
combine methods to get custom windows for full screen animation

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

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2025-06-02 09:09:22 UTC (rev 
15344)
+++ trunk/SKMainWindowController_FullScreen.m   2025-06-02 09:35:57 UTC (rev 
15345)
@@ -546,14 +546,20 @@
             [(animate ? (id)[view animator] : (id)view) setAlphaValue:alpha];
 }
 
-static inline NSMutableArray *openWindows(NSWindowController 
*windowController) {
-    NSMutableArray *openWindows = [NSMutableArray array];
-    for (NSWindowController *wc in [[windowController document] 
windowControllers]) {
+- (NSArray *)customWindowsToEnterOrExitFullScreen:(BOOL)force {
+    NSMutableArray *windows = [NSMutableArray array];
+    for (NSWindowController *wc in [[self document] windowControllers]) {
         NSWindow *window = [wc window];
         if ([window isVisible])
-            [openWindows addObject:window];
+            [windows addObject:window];
     }
-    return openWindows;
+    if (force == NO && [windows count] == 1)
+        return nil;
+    if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceMotion]) {
+        savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:[[self window] frame]];
+        [windows addObject:savedNormalWindow];
+    }
+    return windows;
 }
 
 - (void)windowWillEnterFullScreenStyle:(NSWindow *)window {
@@ -597,14 +603,7 @@
 }
 
 - (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window {
-    NSMutableArray *windows = openWindows(self);
-    if ([windows count] == 1)
-        return nil;
-    if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceMotion]) {
-        savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:[window frame]];
-        [windows addObject:savedNormalWindow];
-    }
-    return windows;
+    return [self customWindowsToEnterOrExitFullScreen:NO];
 }
 
 - (void)window:(NSWindow *)window 
startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration {
@@ -690,14 +689,7 @@
 }
 
 - (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window {
-    NSMutableArray *windows = openWindows(self);
-    if ([windows count] == 1 && [[savedNormalSetup 
objectForKey:USECUSTOMANIMATION_KEY] boolValue] == NO)
-        return nil;
-    if ([[NSWorkspace sharedWorkspace] 
accessibilityDisplayShouldReduceMotion]) {
-        savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:[window frame]];
-        [windows addObject:savedNormalWindow];
-    }
-    return windows;
+    return [self customWindowsToEnterOrExitFullScreen:[[savedNormalSetup 
objectForKey:USECUSTOMANIMATION_KEY] boolValue]];
 }
 
 - (void)window:(NSWindow *)window 
startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration {

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