Revision: 7142
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7142&view=rev
Author:   hofman
Date:     2011-03-09 12:17:08 +0000 (Wed, 09 Mar 2011)

Log Message:
-----------
only post document did show notification when document window is first shown

Modified Paths:
--------------
    trunk/SKMainDocument.m
    trunk/SKNotesDocument.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2011-03-09 12:07:04 UTC (rev 7141)
+++ trunk/SKMainDocument.m      2011-03-09 12:17:08 UTC (rev 7142)
@@ -220,6 +220,8 @@
 }
 
 - (void)showWindows{
+    BOOL wasVisible = [[self mainWindowController] isWindowLoaded] && [[[self 
mainWindowController] window] isVisible];
+    
     [super showWindows];
     
     // Get the search string keyword if available (Spotlight passes this)
@@ -244,7 +246,8 @@
         [[self mainWindowController] 
displaySearchResultsForString:searchString];
     }
     
-    [[NSNotificationCenter defaultCenter] 
postNotificationName:SKDocumentDidShowNotification object:self];
+    if (wasVisible == NO)
+        [[NSNotificationCenter defaultCenter] 
postNotificationName:SKDocumentDidShowNotification object:self];
 }
 
 - (void)removeWindowController:(NSWindowController *)windowController {

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2011-03-09 12:07:04 UTC (rev 7141)
+++ trunk/SKNotesDocument.m     2011-03-09 12:17:08 UTC (rev 7142)
@@ -120,8 +120,11 @@
 }
 
 - (void)showWindows{
+    NSWindowController *wc = [[self windowControllers] lastObject];
+    BOOL wasVisible = [wc isWindowLoaded] && [[wc window] isVisible];
     [super showWindows];
-    [[NSNotificationCenter defaultCenter] 
postNotificationName:SKDocumentDidShowNotification object:self];
+    if (wasVisible == NO)
+        [[NSNotificationCenter defaultCenter] 
postNotificationName:SKDocumentDidShowNotification object:self];
 }
 
 - (void)windowControllerDidLoadNib:(NSWindowController *)aController {


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

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to