Make sure cursor is reset before calling event handlers, misc. formatting

This commit is contained in:
Aparajita Fishman
2013-02-18 03:34:42 -05:00
parent 1c6d2f7fa4
commit 4a09feed59
3 changed files with 12 additions and 13 deletions
+8 -8
View File
@@ -617,6 +617,14 @@ CPRunContinuesResponse = -1002;
[[theWindow platformWindow] _propagateCurrentDOMEvent:willPropagate];
#endif
if ([anEvent type] == CPMouseMoved)
{
if (theWindow !== _lastMouseMoveWindow)
[_lastMouseMoveWindow _mouseExitedResizeRect];
_lastMouseMoveWindow = theWindow;
}
if (_eventListeners.length)
{
var listener = _eventListeners[_eventListeners.length - 1];
@@ -637,14 +645,6 @@ CPRunContinuesResponse = -1002;
return;
}
if ([anEvent type] == CPMouseMoved)
{
if (theWindow !== _lastMouseMoveWindow)
[_lastMouseMoveWindow _mouseExitedResizeRect];
_lastMouseMoveWindow = theWindow;
}
if (theWindow)
[theWindow sendEvent:anEvent];
}
+1
View File
@@ -1576,6 +1576,7 @@ var CPViewFlags = { },
- (void)rightMouseDown:(CPEvent)anEvent
{
var menu = [self menuForEvent:anEvent];
if (menu)
[CPMenu popUpContextMenu:menu withEvent:anEvent forView:self];
else if ([[self nextResponder] isKindOfClass:CPView])
+3 -5
View File
@@ -133,15 +133,12 @@
// List of all open native windows
var PlatformWindows = [CPSet set];
// Define up here so compressor knows about em.
// Define up here so compressor knows about them.
var CPDOMEventGetClickCount,
CPDOMEventStop,
StopDOMEventPropagation,
StopContextMenuDOMEventPropagation;
//right now we hard code q, w, r and t as keys to propogate
//these aren't normal keycodes, they are with modifier key codes
//might be mac only, we should investigate futher later.
var KeyCodesToPrevent = {},
CharacterKeysToPrevent = {},
KeyCodesToAllow = {},
@@ -1267,6 +1264,7 @@ var resizeTimer = nil;
[_CPToolTip invalidateCurrentToolTipIfNeeded];
var button = aDOMEvent.button;
_mouseDownIsRightClick = button == 2 || (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && button == 0 && modifierFlags & CPControlKeyMask);
if (sourceElement.tagName === "INPUT" && sourceElement != _DOMFocusElement)
@@ -1653,7 +1651,7 @@ var resizeTimer = nil;
+ (void)preventCharacterKeysFromPropagating:(CPArray)characters
{
for (var i = characters.length; i > 0; i--)
CharacterKeysToPrevent[""+characters[i-1].toLowerCase()] = YES;
CharacterKeysToPrevent["" + characters[i - 1].toLowerCase()] = YES;
}
/*!