Revision: 15335 http://sourceforge.net/p/skim-app/code/15335 Author: hofman Date: 2025-05-31 09:25:24 +0000 (Sat, 31 May 2025) Log Message: ----------- Always use our animation to exit full screen when we entered with our resize animation, otherwise the system's animation may get the target frame wrong
Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-05-30 14:41:00 UTC (rev 15334) +++ trunk/SKMainWindowController.m 2025-05-31 09:25:24 UTC (rev 15335) @@ -159,6 +159,7 @@ #define SCROLLPOINT_KEY @"scrollPoint" #define LOCKED_KEY @"locked" #define CROPBOXES_KEY @"cropBpxes" +#define USECUSTOMANIMATION_KEY @"useCustomAnimation" #define TRANSITION_KEY @"transition" #define PAGETRANSITIONS_KEY @"pageTransitions" @@ -620,7 +621,7 @@ [setup addEntriesFromDictionary:[self currentPDFSettings]]; if ([self interactionMode] != SKNormalMode || [[pdfView document] isLocked]) { [setup addEntriesFromDictionary:savedNormalSetup]; - [setup removeObjectsForKeys:@[HASHORIZONTALSCROLLER_KEY, HASVERTICALSCROLLER_KEY, AUTOHIDESSCROLLERS_KEY, DRAWSBACKGROUND_KEY, TABGROUP_KEY, TABINDEX_KEY, LOCKED_KEY]]; + [setup removeObjectsForKeys:@[HASHORIZONTALSCROLLER_KEY, HASVERTICALSCROLLER_KEY, AUTOHIDESSCROLLERS_KEY, DRAWSBACKGROUND_KEY, TABGROUP_KEY, TABINDEX_KEY, USECUSTOMANIMATION_KEY, LOCKED_KEY]]; } return setup; Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-05-30 14:41:00 UTC (rev 15334) +++ trunk/SKMainWindowController_FullScreen.m 2025-05-31 09:25:24 UTC (rev 15335) @@ -76,6 +76,7 @@ #define DRAWSBACKGROUND_KEY @"drawsBackground" #define TABGROUP_KEY @"tabGroup" #define TABINDEX_KEY @"tabIndex" +#define USECUSTOMANIMATION_KEY @"useCustomAnimation" #define SKAutoHideToolbarInFullScreenKey @"SKAutoHideToolbarInFullScreen" #define SKResizablePresentationKey @"SKResizablePresentation" @@ -601,6 +602,8 @@ if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]) { savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[window frame]]; [windows addObject:savedNormalWindow]; + } else { + [savedNormalSetup setObject:@YES forKey:USECUSTOMANIMATION_KEY]; } return windows; } @@ -658,8 +661,10 @@ - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { [self window:window willBecomeFullScreen:NO]; - if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) + if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] < 3) [savedNormalSetup removeAllObjects]; + else + [savedNormalSetup removeObjectForKey:USECUSTOMANIMATION_KEY]; [self forceSubwindowsOnTop:NO]; savedNormalWindow = nil; mwcFlags.isSwitchingFullScreen = 0; @@ -671,7 +676,7 @@ - (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window { NSMutableArray *windows = openWindows(self); - if ([windows count] == 1) + if ([windows count] == 1 && [[savedNormalSetup objectForKey:USECUSTOMANIMATION_KEY] boolValue] == NO) return nil; if ([[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]) { savedNormalWindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[window frame]]; @@ -724,8 +729,10 @@ NSString *frameString = [savedNormalSetup objectForKey:MAINWINDOWFRAME_KEY]; if (frameString) [[self window] setFrame:NSRectFromString(frameString) display:YES]; - if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] == 1) + if ([[pdfView document] isLocked] == NO || [savedNormalSetup count] < 3) [savedNormalSetup removeAllObjects]; + else + [savedNormalSetup removeObjectForKey:USECUSTOMANIMATION_KEY]; [self forceSubwindowsOnTop:NO]; mwcFlags.isSwitchingFullScreen = 0; if (mwcFlags.wantsPresentationOrFullScreen) { 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