Revision: 12333
          http://sourceforge.net/p/skim-app/code/12333
Author:   hofman
Date:     2021-05-15 09:45:33 +0000 (Sat, 15 May 2021)
Log Message:
-----------
Ignore mouse position for trascking area when window is not there or not visible

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2021-05-15 09:22:28 UTC (rev 12332)
+++ trunk/SKPDFView.m   2021-05-15 09:45:33 UTC (rev 12333)
@@ -428,6 +428,7 @@
         NSRect visibleRect = [self visibleContentRect];
         NSView *docView = [self documentView];
         BOOL hasLinkToolTips = (toolMode == SKTextToolMode || toolMode == 
SKMoveToolMode || toolMode == SKNoteToolMode);
+        BOOL hasWindow = [[self window] isVisible];
         NSPoint mouseLoc = [docView convertPointFromScreen:[NSEvent 
mouseLocation]];
         BOOL isInside = NO;
         
@@ -439,7 +440,7 @@
                         rect = [self convertRect:rect toView:docView];
                         NSDictionary *userInfo = [[NSDictionary alloc] 
initWithObjectsAndKeys:annotation, SKAnnotationKey, nil];
                         NSTrackingAreaOptions options = 
NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp;
-                        if (NSPointInRect(mouseLoc, rect)) {
+                        if (hasWindow && NSPointInRect(mouseLoc, rect)) {
                             options |= NSTrackingAssumeInside;
                             isInside = YES;
                         }
@@ -452,7 +453,7 @@
             }
         }
         
-        if (isInside == NO)
+        if (hasWindow && isInside == NO)
             [[SKImageToolTipWindow sharedToolTipWindow] fadeOut];
     }
 }

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to