Revision: 16502
http://sourceforge.net/p/skim-app/code/16502
Author: hofman
Date: 2026-09-20 10:00:16 +0000 (Sun, 20 Sep 2026)
Log Message:
-----------
store string of markup notes as associated object rather than in contents on
macOS/iOS 27+, so PDFKit does not add annoying popup comment bubbles.
Modified Paths:
--------------
trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-19 17:06:07 UTC
(rev 16501)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-20 10:00:16 UTC
(rev 16502)
@@ -945,7 +945,17 @@
objc_setAssociatedObject(self, &SKNIsSkimNoteKey, flag ? [NSNumber
numberWithBool:YES] : nil, OBJC_ASSOCIATION_RETAIN);
}
+static char SKNStringKey;
+
- (NSString *)string {
+ if (@available(macOS 27.0, iOS 27.0, *)) {
+ static NSSet *markupTypes = nil;
+ if (markupTypes == nil)
+ markupTypes = [[NSSet alloc] initWithObjects:SKNHighlightString,
SKNUnderlineString, SKNStrikeOutString, SKNMarkUpString, SKNSquigglyString,
nil];
+ if ([markupTypes containsObject:[self type]]) {
+ return objc_getAssociatedObject(self, &SKNStringKey);
+ }
+ }
if ([[self type] isEqualToString:SKNWidgetString] == NO) {
return [self contents];
} else if ([self respondsToSelector:@selector(valueForAnnotationKey:)]) {
@@ -970,6 +980,15 @@
}
- (void)setString:(NSString *)string {
+ if (@available(macOS 27.0, iOS 27.0, *)) {
+ static NSSet *markupTypes = nil;
+ if (markupTypes == nil)
+ markupTypes = [[NSSet alloc] initWithObjects:SKNHighlightString,
SKNUnderlineString, SKNStrikeOutString, SKNMarkUpString, SKNSquigglyString,
nil];
+ if ([markupTypes containsObject:[self type]]) {
+ objc_setAssociatedObject(self, &SKNStringKey, string,
OBJC_ASSOCIATION_RETAIN);
+ return;
+ }
+ }
if ([[self type] isEqualToString:SKNWidgetString] == NO) {
[self setContents:string];
} else if ([self
respondsToSelector:@selector(setValue:forAnnotationKey:)]) {
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