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/SPTextAndLinkCell.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/SPTextAndLinkCell.m') diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index 2aefbff5..9759903d 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -183,7 +183,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) // Fast case for no link - make entire cell editable click area if (!hasLink || !linkActive) return NSCellHitContentArea | NSCellHitEditableTextArea; - NSPoint p = [[[NSApp mainWindow] contentView] convertPoint:[event locationInWindow] toView:controlView]; + NSPoint p = [[[controlView window] contentView] convertPoint:[event locationInWindow] toView:controlView]; NSRect linkRect = SPTextLinkRectFromCellRect(cellFrame); // Hit the link if it falls within the link rectangle for this cell, set when drawing @@ -233,7 +233,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) // Capture the clicked row and cell NSTableView *tableView = (NSTableView *)[self controlView]; - p = [[[NSApp mainWindow] contentView] convertPoint:[theEvent locationInWindow] toView:tableView]; + p = [[[tableView window] contentView] convertPoint:[theEvent locationInWindow] toView:tableView]; lastLinkColumn = [tableView columnAtPoint:p]; lastLinkRow = [tableView rowAtPoint:p]; -- cgit v1.2.3