From cdcb30a6aa1519bfb2f183165fef11cbf278bc7c Mon Sep 17 00:00:00 2001 From: mac Date: Sat, 31 Oct 2026 12:13:25 +0800 Subject: [PATCH] fix: defer remote group accessibility updates until the host parameter action has ended --- 大鱼调色/Plugin/DYInspector.mm | 6 ++++-- 大鱼调色/Plugin/Info.plist | 2 +- 大鱼调色/Wrapper Application/Info.plist | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/大鱼调色/Plugin/DYInspector.mm b/大鱼调色/Plugin/DYInspector.mm index ad5c4f3..754eb30 100644 --- a/大鱼调色/Plugin/DYInspector.mm +++ b/大鱼调色/Plugin/DYInspector.mm @@ -667,6 +667,7 @@ static NSImage *DYWheelImage(void) { if(_refreshing||!_manager)return; id action=[self actionAPI]; if(!action)return; _refreshing=YES; + BOOL groupingChanged=NO; [action startAction:self]; @try { CMTime t=action.currentTime; @@ -683,7 +684,6 @@ static NSImage *DYWheelImage(void) { NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))]; } for(id graphic in _graphics)[graphic setValues:graphicValues]; - BOOL groupingChanged=NO; for(NSMutableDictionary *c in _cards) { NSNumber *pid=c[@"section"][@"enabled"]; double v=[c[@"section"][@"defaultEnabled"]doubleValue];if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t]; @@ -713,8 +713,10 @@ static NSImage *DYWheelImage(void) { } for(NSInteger i=1;i<5;i++)if([assets.paths[[NSString stringWithFormat:@"look%ld",(long)i]]length])_visibleLooks=MAX(_visibleLooks,i+1); [self setNeedsLayout:YES]; - if(groupingChanged){[self layoutSubtreeIfNeeded];NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);} } @finally { [action endAction:self]; _refreshing=NO; } + // Remote layout/accessibility can re-enter the host. Let the parameter + // action and current callback unwind before notifying the remote view. + if(groupingChanged)dispatch_async(dispatch_get_main_queue(),^{NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);}); } - (void)postChanged { [[NSNotificationCenter defaultCenter] postNotificationName:@"DYModelChanged" object:_manager]; } - (void)scalarChanged:(NSControl *)sender { diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 24e5fdd..3e56633 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.1.2 CFBundleVersion - 10 + 11 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index b95d10d..cbc6eee 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.1.2 CFBundleVersion - 10 + 11 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright