Revision: 16490
http://sourceforge.net/p/skim-app/code/16490
Author: hofman
Date: 2026-09-17 15:34:05 +0000 (Thu, 17 Sep 2026)
Log Message:
-----------
make sure presentation view is first responder wqhen its window becomes key
Modified Paths:
--------------
trunk/PDFDocument_SKExtensions.m
trunk/SKMainWindowController.m
trunk/SKMainWindowController_UI.m
Modified: trunk/PDFDocument_SKExtensions.m
===================================================================
--- trunk/PDFDocument_SKExtensions.m 2026-09-17 08:51:05 UTC (rev 16489)
+++ trunk/PDFDocument_SKExtensions.m 2026-09-17 15:34:05 UTC (rev 16490)
@@ -326,8 +326,14 @@
PDFAnnotation *popup = [annotation popup];
NSDictionary *userInfo = @{SKPDFDocumentAnnotationKey:annotation,
SKPDFDocumentPageKey:page};
[page addAnnotation:annotation];
- if (popup && [[page annotations] containsObject:popup] == NO)
- [page addAnnotation:popup];
+ if (popup) {
+ if ([annotation isSkimNote]) {
+ [page removeAnnotation:popup];
+ [annotation setPopup:nil];
+ } else if ([[page annotations] containsObject:popup] == NO) {
+ [page addAnnotation:popup];
+ }
+ }
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFDocumentDidAddAnnotationNotification object:self
userInfo:userInfo];
}
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2026-09-17 08:51:05 UTC (rev 16489)
+++ trunk/SKMainWindowController.m 2026-09-17 15:34:05 UTC (rev 16490)
@@ -1278,6 +1278,10 @@
[annotation setShouldPrint:shouldDisplay];
// there is nothing to observe PDFDocument notifications at
this point
[page addAnnotation:annotation];
+ if ([annotation popup]) {
+ [page removeAnnotation:[annotation popup]];
+ [annotation setPopup:nil];
+ }
[addedNotes addObject:annotation];
}
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2026-09-17 08:51:05 UTC (rev 16489)
+++ trunk/SKMainWindowController_UI.m 2026-09-17 15:34:05 UTC (rev 16490)
@@ -231,6 +231,13 @@
}
}
+- (void)windowDidBecomeKey:(NSNotification *)notification {
+ if ([self interactionMode] == SKPresentationMode && [[self window]
firstResponder] != presentationView && [self window] == [presentationView
window]) {
+ [[self window] makeFirstResponder:presentationView];
+ }
+}
+
+
- (void)windowDidResignKey:(NSNotification *)notification {
if ([self interactionMode] != SKPresentationMode) {
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
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