Revision: 6991
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6991&view=rev
Author:   hofman
Date:     2010-12-18 22:17:23 +0000 (Sat, 18 Dec 2010)

Log Message:
-----------
start remote control in auto mode, so it will handle (un)activating with app 
focus automatically

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

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2010-12-18 15:03:16 UTC (rev 6990)
+++ trunk/SKApplicationController.m     2010-12-18 22:17:23 UTC (rev 6991)
@@ -207,6 +207,12 @@
     [nc addObserver:self 
selector:@selector(handleWindowDidBecomeMainNotification:) 
                              name:NSWindowDidBecomeMainNotification 
object:nil];
     [self registerCurrentDocuments:nil];
+    
+    // kHIDRemoteModeExclusiveAuto lets the HIDRemote handle activation when 
the app gets or loses focus
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKEnableAppleRemoteKey]) {
+        [[HIDRemote sharedHIDRemote] 
startRemoteControl:kHIDRemoteModeExclusiveAuto];
+        [[HIDRemote sharedHIDRemote] setDelegate:self];
+    }
 }
 
 // we don't want to reopen last open files when re-activating the app
@@ -214,20 +220,6 @@
     return flag;
 }
 
-- (void)applicationDidBecomeActive:(NSNotification *)aNotification {
-    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKEnableAppleRemoteKey]) {
-        if ([[HIDRemote sharedHIDRemote] 
startRemoteControl:kHIDRemoteModeExclusive])
-            [[HIDRemote sharedHIDRemote] setDelegate:self];
-    }
-}
-
-- (void)applicationWillResignActive:(NSNotification *)aNotification {
-    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKEnableAppleRemoteKey]) {
-        [[HIDRemote sharedHIDRemote] stopRemoteControl];
-        [[HIDRemote sharedHIDRemote] setDelegate:nil];
-    }
-}
-
 - (void)applicationStartsTerminating:(NSNotification *)aNotification {
     [self registerCurrentDocuments:aNotification];
     NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];


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

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to