Revision: 14235
          http://sourceforge.net/p/skim-app/code/14235
Author:   hofman
Date:     2024-04-23 15:53:44 +0000 (Tue, 23 Apr 2024)
Log Message:
-----------
Pass frame to presentation window initializer

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

Modified: trunk/SKFullScreenWindow.h
===================================================================
--- trunk/SKFullScreenWindow.h  2024-04-23 15:42:23 UTC (rev 14234)
+++ trunk/SKFullScreenWindow.h  2024-04-23 15:53:44 UTC (rev 14235)
@@ -43,7 +43,7 @@
 
 @interface SKFullScreenWindow : SKMainWindow
 
-- (instancetype)initWithScreen:(NSScreen *)screen;
+- (instancetype)initWithContentRect:(NSRect)contentRect;
 
 @end
 

Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m  2024-04-23 15:42:23 UTC (rev 14234)
+++ trunk/SKFullScreenWindow.m  2024-04-23 15:53:44 UTC (rev 14235)
@@ -40,9 +40,8 @@
 
 @implementation SKFullScreenWindow
 
-- (instancetype)initWithScreen:(NSScreen *)screen {
-    NSRect screenFrame = [(screen ?: [NSScreen mainScreen]) frame];
-    self = [self initWithContentRect:screenFrame 
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+- (instancetype)initWithContentRect:(NSRect)contentRect {
+    self = [self initWithContentRect:contentRect 
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     if (self) {
         [self setBackgroundColor:[NSColor blackColor]];
         [self setLevel:NSPopUpMenuWindowLevel];
@@ -50,7 +49,7 @@
         [self setDisplaysWhenScreenProfileChanges:YES];
         [self setExcludedFromWindowsMenu:NO];
         // appartently this is needed for secondary screens
-        [self setFrame:screenFrame display:NO];
+        [self setFrame:contentRect display:NO];
         [self setAnimationBehavior:NSWindowAnimationBehaviorNone];
         [self setCollectionBehavior:NSWindowCollectionBehaviorManaged];
         [[self contentView] setWantsLayer:YES];

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2024-04-23 15:42:23 UTC (rev 
14234)
+++ trunk/SKMainWindowController_FullScreen.m   2024-04-23 15:53:44 UTC (rev 
14235)
@@ -405,7 +405,7 @@
             screen = [screens firstObject];
     }
     
-    NSWindow *presentationWindow = [[SKFullScreenWindow alloc] 
initWithScreen:screen ?: [mainWindow screen]];
+    NSWindow *presentationWindow = [[SKFullScreenWindow alloc] 
initWithContentRect:[screen ?: [mainWindow screen] frame]];
     [presentationWindow setAlphaValue:0.0];
     [self displayStaticContentInPresentationWindow:presentationWindow];
     [presentationWindow orderFront:nil];

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