Revision: 2678
http://skim-app.svn.sourceforge.net/skim-app/?rev=2678&view=rev
Author: hofman
Date: 2007-08-17 16:26:25 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
Explicitly pass the screen for sidewindows and navigation windows, rather than
getting it from the current window. The screen may not be set yet, as it is
changed asynchronously when the window is displayed, not when the window frame
is set.
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKPDFView.h
trunk/SKPDFView.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2007-08-17 18:41:25 UTC (rev 2677)
+++ trunk/SKMainWindowController.m 2007-08-17 23:26:25 UTC (rev 2678)
@@ -133,11 +133,11 @@
- (void)setupToolbar;
-- (void)showLeftSideWindow;
-- (void)showRightSideWindow;
+- (void)showLeftSideWindowOnScreen:(NSScreen *)screen;
+- (void)showRightSideWindowOnScreen:(NSScreen *)screen;
- (void)hideLeftSideWindow;
- (void)hideRightSideWindow;
-- (void)showSideWindows;
+- (void)showSideWindowsOnScreen:(NSScreen *)screen;
- (void)hideSideWindows;
- (void)goFullScreen;
- (void)removeFullScreen;
@@ -1777,7 +1777,7 @@
if ([leftSideWindow isVisible])
[self hideLeftSideWindow];
else
- [self showLeftSideWindow];
+ [self showLeftSideWindowOnScreen:[[self window] screen]];
} else {
NSRect sideFrame = [leftSideContentBox frame];
NSRect pdfFrame = [pdfContentBox frame];
@@ -1862,10 +1862,7 @@
#pragma mark Full Screen support
-- (void)showLeftSideWindow {
- NSScreen *screen = [[self window] screen];
- if (screen == nil)
- screen = [NSScreen mainScreen];
+- (void)showLeftSideWindowOnScreen:(NSScreen *)screen {
if (leftSideWindow == nil)
leftSideWindow = [[SKSideWindow alloc] initWithMainController:self
edge:NSMinXEdge];
@@ -1893,10 +1890,7 @@
}
}
-- (void)showRightSideWindow {
- NSScreen *screen = [[self window] screen]; // @@ or should we use the main
screen?
- if (screen == nil)
- screen = [NSScreen mainScreen];
+- (void)showRightSideWindowOnScreen:(NSScreen *)screen {
if (rightSideWindow == nil)
rightSideWindow = [[SKSideWindow alloc] initWithMainController:self
edge:NSMaxXEdge];
@@ -1962,9 +1956,9 @@
}
}
-- (void)showSideWindows {
- [self showLeftSideWindow];
- [self showRightSideWindow];
+- (void)showSideWindowsOnScreen:(NSScreen *)screen {
+ [self showLeftSideWindowOnScreen:screen];
+ [self showRightSideWindowOnScreen:screen];
[pdfView setFrame:NSInsetRect([[pdfView superview] bounds], 9.0, 0.0)];
[[pdfView superview] setNeedsDisplay:YES];
@@ -2176,8 +2170,8 @@
if ([fullScreenSetup count])
[self applyPDFSettings:fullScreenSetup];
- [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey]
autohidesCursor:NO];
- [self showSideWindows];
+ [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey]
autohidesCursor:NO screen:screen];
+ [self showSideWindowsOnScreen:screen];
}
- (IBAction)enterPresentation:(id)sender {
@@ -2199,7 +2193,7 @@
else
[self goFullScreen];
- [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey]
autohidesCursor:YES];
+ [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey]
autohidesCursor:YES screen:nil];
}
- (IBAction)exitFullScreen:(id)sender {
@@ -2211,7 +2205,7 @@
if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView])
[fullScreenWindow makeFirstResponder:nil];
- [pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO];
+ [pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO
screen:nil];
[pdfView setFrame:[[pdfContentBox contentView] bounds]];
[pdfContentBox addSubview:pdfView]; // this should be done before
exitPresentationMode to get a smooth transition
Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h 2007-08-17 18:41:25 UTC (rev 2677)
+++ trunk/SKPDFView.h 2007-08-17 23:26:25 UTC (rev 2678)
@@ -170,7 +170,7 @@
- (void)takeSnapshot:(id)sender;
-- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor;
+- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen;
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page;
- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation;
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-08-17 18:41:25 UTC (rev 2677)
+++ trunk/SKPDFView.m 2007-08-17 23:26:25 UTC (rev 2678)
@@ -2142,7 +2142,7 @@
[navWindow orderOut:self];
}
-- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor {
+- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen {
hasNavigation = hasNav;
autohidesCursor = hideCursor;
activateNavigationAtBottom = atBottom;
@@ -2155,7 +2155,7 @@
[[NSNotificationCenter defaultCenter] addObserver: self selector:
@selector(handleWindowWillCloseNotification:)
name:
NSWindowWillCloseNotification object: [self window]];
navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
- [navWindow moveToScreen:[[self window] screen]];
+ [navWindow moveToScreen:screen];
[navWindow setLevel:[[self window] level] + 1];
} else if ([navWindow isVisible]) {
[navWindow orderOut:self];
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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit