From b089a0d3249d3139bedc2679a36efa705d2bae04 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 21 Oct 2015 00:39:34 +0200 Subject: Fix bundle commands no longer working in popup field editor (and possibly other cases) (#2299) Replacing some [NSApp mainWindow] with their actually intended calls [NSApp keyWindow] and [view window] --- Source/SPTableContentDelegate.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/SPTableContentDelegate.m') diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index 07c355b9..4d14180b 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -148,18 +148,18 @@ if (!correspondingWindowFound) stopTrigger = YES; } if (!stopTrigger) { - + id firstResponder = [[NSApp keyWindow] firstResponder]; if ([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { [[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem]; } else if ([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { - if ([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"]) { - [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForDataTable:aMenuItem]; + if ([[[firstResponder class] description] isEqualToString:@"SPCopyTable"]) { + [[firstResponder onMainThread] executeBundleItemForDataTable:aMenuItem]; } } else if ([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) { - if ([[[NSApp mainWindow] firstResponder] isKindOfClass:[NSTextView class]]) { - [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForInputField:aMenuItem]; + if ([firstResponder isKindOfClass:[NSTextView class]]) { + [[firstResponder onMainThread] executeBundleItemForInputField:aMenuItem]; } } } -- cgit v1.2.3