From e292bf01d7756ac0309ecd527f6210bbd5e5f37e Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Sun, 20 Jan 2013 09:13:17 +0700 Subject: [PATCH] Fixed mouse down within the resize slop outside a window not resizing --- AppKit/CPWindow/_CPWindow.j | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/AppKit/CPWindow/_CPWindow.j b/AppKit/CPWindow/_CPWindow.j index fddccea40..5b34a8c53 100644 --- a/AppKit/CPWindow/_CPWindow.j +++ b/AppKit/CPWindow/_CPWindow.j @@ -1764,7 +1764,19 @@ CPTexturedBackgroundWindowMask case CPRightMouseDown: _leftMouseDownView = [_windowView hitTest:point]; - if (_leftMouseDownView != _firstResponder && [_leftMouseDownView acceptsFirstResponder]) + /* + hitTest: will only test within the window's frame. + If that fails, check if a left mousedown is within + the resize slop outside the frame. + */ + if (!_leftMouseDownView && + type === CPLeftMouseDown && + [self _isValidMousePoint:[self convertBaseToGlobal:point]]) + { + _leftMouseDownView = _windowView; + } + + if (_leftMouseDownView !== _firstResponder && [_leftMouseDownView acceptsFirstResponder]) [self makeFirstResponder:_leftMouseDownView]; [CPApp activateIgnoringOtherApps:YES]; @@ -3334,6 +3346,7 @@ var keyViewComparator = function(lhs, rhs, context) return _CGRectContainsPoint(_frame, aPoint); } +/* aPoint should be global */ - (BOOL)_isValidMousePoint:(CGPoint)aPoint { // If we are using the new resizing mode, mouse events are valid