Revision: 12665
          http://sourceforge.net/p/skim-app/code/12665
Author:   hofman
Date:     2021-12-30 22:04:31 +0000 (Thu, 30 Dec 2021)
Log Message:
-----------
Reset temp toolmode on resign key or main

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2021-12-30 14:59:43 UTC (rev 12664)
+++ trunk/SKPDFView.m   2021-12-30 22:04:31 UTC (rev 12665)
@@ -3082,10 +3082,14 @@
         if (activeAnnotation)
             [self setNeedsDisplayForAnnotation:activeAnnotation];
     }
-    if (notification)
+    if ([[notification name] isEqualToString:NSWindowDidResignKeyNotification])
         [self setTemporaryToolMode:SKNoToolMode];
 }
 
+- (void)handleMainStateChangedNotification:(NSNotification *)notification {
+    [self setTemporaryToolMode:SKNoToolMode];
+}
+
 #pragma mark Key and window changes
 
 - (void)viewWillMoveToWindow:(NSWindow *)newWindow {
@@ -3109,11 +3113,13 @@
     if (oldWindow) {
         [nc removeObserver:self name:NSWindowDidBecomeKeyNotification 
object:oldWindow];
         [nc removeObserver:self name:NSWindowDidResignKeyNotification 
object:oldWindow];
+        [nc removeObserver:self name:NSWindowDidResignMainNotification 
object:oldWindow];
     }
     if (newWindow) {
         pdfvFlags.inKeyWindow = [newWindow isKeyWindow];
         [nc addObserver:self 
selector:@selector(handleKeyStateChangedNotification:) 
name:NSWindowDidBecomeKeyNotification object:newWindow];
         [nc addObserver:self 
selector:@selector(handleKeyStateChangedNotification:) 
name:NSWindowDidResignKeyNotification object:newWindow];
+        [nc addObserver:self 
selector:@selector(handleMainStateChangedNotification:) 
name:NSWindowDidResignMainNotification object:newWindow];
     }
     
     [super viewWillMoveToWindow:newWindow];

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