mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
If an event listener is marked to dequeue, dequeue even if the event does not match the mask
* Note that this does not match the Cocoa documentation, but a whole bunch of event handling code relies on this behavior, so I have to keep it the way it was. * Fixed dequeue flag in CPApplication -runModalSession: * Added a window title in CPAlertTest
This commit is contained in:
+15
-7
@@ -556,7 +556,7 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
// [theWindow._bridge _obscureWindowsBelowModalWindow];
|
||||
|
||||
[CPApp setCallback:_CPRunModalLoop forNextEventMatchingMask:CPAnyEventMask untilDate:nil inMode:0 dequeue:NO];
|
||||
[CPApp setCallback:_CPRunModalLoop forNextEventMatchingMask:CPAnyEventMask untilDate:nil inMode:0 dequeue:YES];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -619,14 +619,22 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
if (_eventListeners.length)
|
||||
{
|
||||
if (_eventListeners[_eventListeners.length - 1]._mask & (1 << [anEvent type]))
|
||||
{
|
||||
var listener = _eventListeners.pop();
|
||||
listener._callback(anEvent);
|
||||
var listener = _eventListeners[_eventListeners.length - 1];
|
||||
|
||||
if (listener._dequeue)
|
||||
return;
|
||||
if (listener._mask & (1 << [anEvent type]))
|
||||
{
|
||||
_eventListeners.pop();
|
||||
listener._callback(anEvent);
|
||||
}
|
||||
|
||||
/*
|
||||
FIXME: This does not match Cocoa documented behavior for the dequeue
|
||||
flag. Cocoa says the event is dequeued only if it matches the mask.
|
||||
Unfortunately event handling code in Cappuccino is depending
|
||||
on an event being dequeued even if it does not match.
|
||||
*/
|
||||
if (listener._dequeue)
|
||||
return;
|
||||
}
|
||||
|
||||
if ([anEvent type] == CPMouseMoved)
|
||||
|
||||
@@ -44,7 +44,9 @@
|
||||
[CPDocModalWindowMask, CPCriticalAlertStyle]
|
||||
];
|
||||
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(100,100,500,500) styleMask:CPTitledWindowMask];
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(100, 100, 500, 500) styleMask:CPTitledWindowMask];
|
||||
[theWindow setTitle:@"CPAlert Test"];
|
||||
|
||||
var contentView = [theWindow contentView];
|
||||
|
||||
label = [[CPTextField alloc] initWithFrame:CGRectMake(15, 15, 400, 24)];
|
||||
|
||||
Reference in New Issue
Block a user