From 19804720af58d9a4617729b626563a21b8e0eaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Wallstro=CC=88m?= Date: Thu, 10 May 2012 13:42:37 +0200 Subject: [PATCH] CPTableView: Don't update selection etc unless becoming first responder succeeds. Fix for issue #1435 --- AppKit/CPTableView.j | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 38b86ff85..7e9e5a815 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -3991,6 +3991,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad */ - (BOOL)startTrackingAt:(CGPoint)aPoint { + if (![[self window] makeFirstResponder:self]) + return NO; + var row = [self rowAtPoint:aPoint]; // If the user clicks outside a row then deselect everything. @@ -4018,7 +4021,6 @@ Your delegate can implement this method to avoid subclassing the tableview to ad if (row >= 0 && !(_implementedDataSourceMethods & CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_)) [self _updateSelectionWithMouseAtRow:row]; - [[self window] makeFirstResponder:self]; return YES; } @@ -4141,6 +4143,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad */ - (void)stopTracking:(CGPoint)lastPoint at:(CGPoint)aPoint mouseIsUp:(BOOL)mouseIsUp { + if ([[self window] firstResponder] !== self) + return; + _isSelectingSession = NO; var CLICK_TIME_DELTA = 1000,