Revision: 15274
          http://sourceforge.net/p/skim-app/code/15274
Author:   hofman
Date:     2025-05-24 15:27:03 +0000 (Sat, 24 May 2025)
Log Message:
-----------
don't use separate method to show main windoww

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

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2025-05-24 15:05:31 UTC (rev 
15273)
+++ trunk/SKMainWindowController_FullScreen.m   2025-05-24 15:27:03 UTC (rev 
15274)
@@ -214,45 +214,6 @@
     [self addPresentationNotesNavigation];
 }
 
-- (void)showNormalWindow {
-    NSWindowTabGroup *tabGroup = [savedNormalSetup objectForKey:TABGROUP_KEY];
-    BOOL moveToTab = [[tabGroup windows] count] > 0;
-    NSWindow *presentationWindow = [self window];
-    
-    [self setWindow:mainWindow];
-    [mainWindow setAlphaValue:0.0];
-    [mainWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
-    [mainWindow setLevel:NSNormalWindowLevel];
-    if (NSPointInRect(SKCenterPoint([mainWindow frame]), [[presentationWindow 
screen] frame]) && moveToTab == NO) {
-        NSWindowCollectionBehavior collectionBehavior = [mainWindow 
collectionBehavior];
-        // trick to make sure the main window shows up in the same space as 
the fullscreen window
-        [mainWindow setCollectionBehavior:collectionBehavior | 
NSWindowCollectionBehaviorMoveToActiveSpace];
-        [mainWindow makeKeyAndOrderFront:nil];
-        dispatch_async(dispatch_get_main_queue(), ^{ [mainWindow 
setCollectionBehavior:collectionBehavior]; });
-    } else {
-        [mainWindow makeKeyAndOrderFront:nil];
-    }
-    [mainWindow display];
-    if ([pdfView window] == mainWindow)
-        [mainWindow makeFirstResponder:pdfView];
-    [mainWindow setDelegate:self];
-    [mainWindow makeKeyWindow];
-    [mainWindow setAnimationBehavior:NSWindowAnimationBehaviorDefault];
-
-    [NSApp removeWindowsItem:presentationWindow];
-    [presentationWindow setLevel:NSPopUpMenuWindowLevel];
-    
-    [NSApp setPresentationOptions:NSApplicationPresentationDefault];
-    
-    if (moveToTab) {
-        NSUInteger tabIndex = [[savedNormalSetup objectForKey:TABINDEX_KEY] 
unsignedIntegerValue];
-        [mainWindow setAlphaValue:1.0];
-        [tabGroup insertWindow:mainWindow atIndex:MIN(tabIndex, [[tabGroup 
windows] count])];
-    } else if (NSContainsRect([presentationWindow frame], [mainWindow frame])) 
{
-        [mainWindow setAlphaValue:1.0];
-    }
-}
-
 - (void)displayStaticContentForWindow:(NSWindow *)window {
     NSRect frame = [window frame];
     CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming | kCGWindowImageBestResolution);
@@ -495,8 +456,42 @@
     
     [touchBarController interactionModeChanged];
     
-    [self showNormalWindow];
+    NSWindowTabGroup *tabGroup = [savedNormalSetup objectForKey:TABGROUP_KEY];
+    BOOL moveToTab = [[tabGroup windows] count] > 0;
     
+    [self setWindow:mainWindow];
+    
+    [mainWindow setAlphaValue:0.0];
+    [mainWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
+    [mainWindow setLevel:NSNormalWindowLevel];
+    if (NSPointInRect(SKCenterPoint([mainWindow frame]), [[presentationWindow 
screen] frame]) && moveToTab == NO) {
+        NSWindowCollectionBehavior collectionBehavior = [mainWindow 
collectionBehavior];
+        // trick to make sure the main window shows up in the same space as 
the fullscreen window
+        [mainWindow setCollectionBehavior:collectionBehavior | 
NSWindowCollectionBehaviorMoveToActiveSpace];
+        [mainWindow makeKeyAndOrderFront:nil];
+        dispatch_async(dispatch_get_main_queue(), ^{ [mainWindow 
setCollectionBehavior:collectionBehavior]; });
+    } else {
+        [mainWindow makeKeyAndOrderFront:nil];
+    }
+    if ([pdfView window] == mainWindow)
+        [mainWindow makeFirstResponder:pdfView];
+    [mainWindow setDelegate:self];
+    [mainWindow makeKeyWindow];
+    [mainWindow setAnimationBehavior:NSWindowAnimationBehaviorDefault];
+
+    [NSApp removeWindowsItem:presentationWindow];
+    [presentationWindow setLevel:NSPopUpMenuWindowLevel];
+    
+    [NSApp setPresentationOptions:NSApplicationPresentationDefault];
+    
+    if (moveToTab) {
+        NSUInteger tabIndex = [[savedNormalSetup objectForKey:TABINDEX_KEY] 
unsignedIntegerValue];
+        [mainWindow setAlphaValue:1.0];
+        [tabGroup insertWindow:mainWindow atIndex:MIN(tabIndex, [[tabGroup 
windows] count])];
+    } else if (NSContainsRect([presentationWindow frame], [mainWindow frame])) 
{
+        [mainWindow setAlphaValue:1.0];
+    }
+    
     // the page number may have changed
     [self updateSubtitle];
     

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