Revision: 6629
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6629&view=rev
Author:   hofman
Date:     2010-07-17 17:34:07 +0000 (Sat, 17 Jul 2010)

Log Message:
-----------
no ivar for fullscreen window, only as a local variable and as the (current) 
window

Modified Paths:
--------------
    trunk/SKMainWindowController.h
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_UI.m

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2010-07-17 16:48:23 UTC (rev 6628)
+++ trunk/SKMainWindowController.h      2010-07-17 17:34:07 UTC (rev 6629)
@@ -66,7 +66,7 @@
 };
 
 @class PDFAnnotation, PDFSelection, SKGroupedSearchResult, SKFloatMapTable;
-...@class SKPDFView, SKSecondaryPDFView, SKStatusBar, SKSplitView, 
SKFullScreenWindow, SKSideWindow;
+...@class SKPDFView, SKSecondaryPDFView, SKStatusBar, SKSplitView, 
SKSideWindow;
 @class SKMainDocument, SKLeftSideViewController, SKRightSideViewController, 
SKMainToolbarController, SKProgressController, 
SKPresentationOptionsSheetController, SKNoteTypeSheetController;
 
 @interface SKMainWindowController : NSWindowController 
<SKSnapshotWindowControllerDelegate, SKThumbnailDelegate> {
@@ -113,7 +113,6 @@
     double                              rating;
     
     NSWindow                            *mainWindow;
-    SKFullScreenWindow                  *fullScreenWindow;
     SKSideWindow                        *leftSideWindow;
     SKSideWindow                        *rightSideWindow;
     NSMutableArray                      *blankingWindows;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2010-07-17 16:48:23 UTC (rev 6628)
+++ trunk/SKMainWindowController.m      2010-07-17 17:34:07 UTC (rev 6629)
@@ -252,7 +252,6 @@
        [[NSNotificationCenter defaultCenter] removeObserver: self];
     [self unregisterAsObserver];
     [mainWindow setDelegate:nil];
-    [fullScreenWindow setDelegate:nil];
     [splitView setDelegate:nil];
     [pdfSplitView setDelegate:nil];
     [pdfView setDelegate:nil];
@@ -274,7 +273,6 @@
     SKDESTROY(lastViewedPages);
        SKDESTROY(leftSideWindow);
        SKDESTROY(rightSideWindow);
-       SKDESTROY(fullScreenWindow);
     SKDESTROY(mainWindow);
     SKDESTROY(statusBar);
     SKDESTROY(savedNormalSetup);
@@ -887,7 +885,7 @@
 }
 
 - (BOOL)isFullScreen {
-    return [self window] == fullScreenWindow && mwcFlags.isPresentation == 0;
+    return [self isWindowLoaded] && [self window] != mainWindow && 
mwcFlags.isPresentation == 0;
 }
 
 - (BOOL)isPresentation {
@@ -1307,12 +1305,8 @@
     NSColor *backgroundColor = [self isPresentation] ? [NSColor blackColor] : 
[[NSUserDefaults standardUserDefaults] 
colorForKey:SKFullScreenBackgroundColorKey];
     NSInteger level = [self isPresentation] && [[NSUserDefaults 
standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO ? 
NSPopUpMenuWindowLevel : NSNormalWindowLevel;
     
-    // Create the full-screen window if it does not already  exist.
-    if (fullScreenWindow == nil)
-        fullScreenWindow = [[SKFullScreenWindow alloc] initWithScreen:screen];
-        
-    // explicitly set window frame; screen may have moved, or may be nil (in 
which case [fullScreenWindow frame] is wrong, which is weird); the first time 
through this method, [fullScreenWindow screen] is nil
-    [fullScreenWindow setFrame:[screen frame] display:NO];
+    // create a new full screen window
+    SKFullScreenWindow *fullScreenWindow = [[[SKFullScreenWindow alloc] 
initWithScreen:screen] autorelease];
     
     if ([[mainWindow firstResponder] isDescendantOf:pdfView])
         [mainWindow makeFirstResponder:nil];
@@ -1384,8 +1378,10 @@
         [pdfView toggleReadingBar];
     
     [pdfView setBackgroundColor:[NSColor clearColor]];
-    [fullScreenWindow setBackgroundColor:[NSColor blackColor]];
-    [fullScreenWindow setLevel:[[NSUserDefaults standardUserDefaults] 
boolForKey:SKUseNormalLevelForPresentationKey] == NO ? NSPopUpMenuWindowLevel : 
NSNormalWindowLevel];
+    if ([self window] != mainWindow) {
+        [[self window] setBackgroundColor:[NSColor blackColor]];
+        [[self window] setLevel:[[NSUserDefaults standardUserDefaults] 
boolForKey:SKUseNormalLevelForPresentationKey] == NO ? NSPopUpMenuWindowLevel : 
NSNormalWindowLevel];
+    }
     
     SKPDFView *notesPdfView = [[self presentationNotesDocument] pdfView];
     if (notesPdfView)
@@ -1427,7 +1423,7 @@
         [self exitPresentationMode];
         [pdfView setFrame:[pdfContentView bounds]];
         [pdfContentView addSubview:pdfView];
-        [fullScreenWindow setMainView:pdfSplitView];
+        [(SKFullScreenWindow *)[self window] setMainView:pdfSplitView];
     } else {
         [self saveNormalSetup];
         [self goFullScreen];
@@ -1436,8 +1432,8 @@
     NSColor *backgroundColor = [[NSUserDefaults standardUserDefaults] 
colorForKey:SKFullScreenBackgroundColorKey];
     [pdfView setBackgroundColor:backgroundColor];
     [secondaryPdfView setBackgroundColor:backgroundColor];
-    [fullScreenWindow setBackgroundColor:backgroundColor];
-    [fullScreenWindow setLevel:NSNormalWindowLevel];
+    [[self window] setBackgroundColor:backgroundColor];
+    [[self window] setLevel:NSNormalWindowLevel];
     
     NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] 
dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey];
     if ([fullScreenSetup count])
@@ -1464,7 +1460,7 @@
     if (wasFullScreen) {
         [pdfSplitView setFrame:[centerContentView bounds]];
         [centerContentView addSubview:pdfSplitView];
-        [fullScreenWindow setMainView:pdfView];
+        [(SKFullScreenWindow *)[self window] setMainView:pdfView];
         [self hideSideWindows];
     } else {
         [self goFullScreen];
@@ -1480,14 +1476,15 @@
     if ([self isFullScreen])
         [self hideSideWindows];
     
-    if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView])
-        [fullScreenWindow makeFirstResponder:nil];
+    if ([[[self window] firstResponder] isDescendantOf:pdfView])
+        [[self window] makeFirstResponder:nil];
     
     // do this first, otherwise the navigation window may be covered by 
fadeWindow and then reveiled again, which looks odd
     [pdfView setInteractionMode:SKNormalMode screen:[[self window] screen]];
     
     // first fade out the pdfView so we can move the pdfView to the main 
window before it's revealed
     // animating the view itself does no work as PDFView does not work nicely 
with CoreAnimation, so we use a temporary window
+    SKFullScreenWindow *fullScreenWindow = [[[self window] retain] 
autorelease];
     SKFullScreenWindow *fadeWindow = [[SKFullScreenWindow alloc] 
initWithScreen:[fullScreenWindow screen] canBecomeMain:NO];
     [fadeWindow setBackgroundColor:[fullScreenWindow backgroundColor]];
     [fadeWindow setLevel:[fullScreenWindow level]];
@@ -1534,8 +1531,6 @@
     [mainWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];
     [mainWindow display];
     [fullScreenWindow fadeOut];
-    [[fullScreenWindow retain] autorelease];
-    SKDESTROY(fullScreenWindow);
     [mainWindow makeFirstResponder:pdfView];
     [mainWindow recalculateKeyViewLoop];
     [mainWindow setDelegate:self];
@@ -2154,8 +2149,8 @@
                 if (color) {
                     [pdfView setBackgroundColor:color];
                     [secondaryPdfView setBackgroundColor:color];
-                    [fullScreenWindow setBackgroundColor:color];
-                    [[fullScreenWindow contentView] setNeedsDisplay:YES];
+                    [[self window] setBackgroundColor:color];
+                    [[[self window] contentView] setNeedsDisplay:YES];
                     
                     for (NSWindow *window in blankingWindows) {
                         [window setBackgroundColor:color];

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2010-07-17 16:48:23 UTC (rev 6628)
+++ trunk/SKMainWindowController_UI.m   2010-07-17 17:34:07 UTC (rev 6629)
@@ -246,7 +246,7 @@
 }
 
 - (void)windowDidChangeScreen:(NSNotification *)notification {
-    if ([[notification object] isEqual:[self window]] && [[notification 
object] isEqual:fullScreenWindow]) {
+    if ([[notification object] isEqual:[self window]] && [[notification 
object] isEqual:mainWindow] == NO) {
         NSScreen *screen = [[self window] screen];
         [[self window] setFrame:[screen frame] display:NO];
         if ([self isFullScreen]) {
@@ -265,7 +265,7 @@
 }
 
 - (void)windowDidMove:(NSNotification *)notification {
-    if ([[notification object] isEqual:[self window]] && [[notification 
object] isEqual:fullScreenWindow]) {
+    if ([[notification object] isEqual:[self window]] && [[notification 
object] isEqual:[self mainWindow]] == NO) {
         NSScreen *screen = [[self window] screen];
         NSRect screenFrame = [screen frame];
         if (NSEqualRects(screenFrame, [[self window] frame]) == NO) {
@@ -1535,13 +1535,13 @@
 
 - (void)handleApplicationDidResignActiveNotification:(NSNotification 
*)notification {
     if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] 
boolForKey:SKUseNormalLevelForPresentationKey] == NO) {
-        [fullScreenWindow setLevel:NSNormalWindowLevel];
+        [[self window] setLevel:NSNormalWindowLevel];
     }
 }
 
 - (void)handleApplicationWillBecomeActiveNotification:(NSNotification 
*)notification {
     if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] 
boolForKey:SKUseNormalLevelForPresentationKey] == NO) {
-        [fullScreenWindow setLevel:NSPopUpMenuWindowLevel];
+        [[self window] setLevel:NSPopUpMenuWindowLevel];
     }
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to