[webkit-changes] cvs commit: WebCore/kwq KWQComboBox.mm
KWQKHTMLPart.mm
David
harrison at opensource.apple.com
Thu Dec 8 14:22:52 PST 2005
harrison 05/12/08 14:22:51
Modified: . ChangeLog
kwq KWQComboBox.mm KWQKHTMLPart.mm
Log:
Reviewed by Geoff.
<rdar://problem/4366496> 10.4.4 Regression: "Corel Painter IX (v9.1)"
crashed when going from the "Open a template" menu to "Select recent
Document" in the "Welcome to Corel XI!" window.
These are the parts of that bug fix that were not already fixed in TOT.
* kwq/KWQComboBox.mm:
(-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
Retain the event because it is the [NSApp currentEvent], which can
change and therefore be released during [super trackMouse:...]
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::sendFakeEventsAfterWidgetTracking):
Allow for the event not being leftmousedown or keydown
Revision Changes Path
1.494 +19 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.493
retrieving revision 1.494
diff -u -r1.493 -r1.494
--- ChangeLog 8 Dec 2005 10:20:37 -0000 1.493
+++ ChangeLog 8 Dec 2005 22:22:46 -0000 1.494
@@ -1,3 +1,22 @@
+2005-12-08 David Harrison <harrison at apple.com>
+
+ Reviewed by Geoff.
+
+ <rdar://problem/4366496> 10.4.4 Regression: "Corel Painter IX (v9.1)"
+ crashed when going from the "Open a template" menu to "Select recent
+ Document" in the "Welcome to Corel XI!" window.
+
+ These are the parts of that bug fix that were not already fixed in TOT.
+
+ * kwq/KWQComboBox.mm:
+ (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+ Retain the event because it is the [NSApp currentEvent], which can
+ change and therefore be released during [super trackMouse:...]
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::sendFakeEventsAfterWidgetTracking):
+ Allow for the event not being leftmousedown or keydown
+
2005-12-08 Mitz Pettel <opendarwin.org at mitzpettel.com>
Reviewed by eseidel. Committed by eseidel.
1.76 +5 -0 WebCore/kwq/KWQComboBox.mm
Index: KWQComboBox.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQComboBox.mm,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- KWQComboBox.mm 3 Dec 2005 20:16:40 -0000 1.75
+++ KWQComboBox.mm 8 Dec 2005 22:22:50 -0000 1.76
@@ -408,6 +408,10 @@
- (BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)rect ofView:(NSView *)view untilMouseUp:(BOOL)flag
{
WebCoreBridge *bridge = box ? [KWQKHTMLPart::bridgeForWidget(box) retain] : nil;
+
+ // we need to retain the event because it is the [NSApp currentEvent], which can change
+ // and therefore be released during [super trackMouse:...]
+ [event retain];
BOOL result = [super trackMouse:event inRect:rect ofView:view untilMouseUp:flag];
if (result && bridge) {
// Give KHTML a chance to fix up its event state, since the popup eats all the
@@ -415,6 +419,7 @@
// at this point!
[bridge part]->sendFakeEventsAfterWidgetTracking(event);
}
+ [event release];
[bridge release];
return result;
}
1.698 +43 -42 WebCore/kwq/KWQKHTMLPart.mm
Index: KWQKHTMLPart.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
retrieving revision 1.697
retrieving revision 1.698
diff -u -r1.697 -r1.698
--- KWQKHTMLPart.mm 8 Dec 2005 08:40:26 -0000 1.697
+++ KWQKHTMLPart.mm 8 Dec 2005 22:22:50 -0000 1.698
@@ -2776,48 +2776,49 @@
_sendingEventToSubview = false;
int eventType = [initiatingEvent type];
- ASSERT(eventType == NSLeftMouseDown || eventType == NSKeyDown);
- NSEvent *fakeEvent = nil;
- if (eventType == NSLeftMouseDown) {
- fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
- location:[initiatingEvent locationInWindow]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- eventNumber:[initiatingEvent eventNumber]
- clickCount:[initiatingEvent clickCount]
- pressure:[initiatingEvent pressure]];
-
- mouseUp(fakeEvent);
- }
- else { // eventType == NSKeyDown
- fakeEvent = [NSEvent keyEventWithType:NSKeyUp
- location:[initiatingEvent locationInWindow]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- characters:[initiatingEvent characters]
- charactersIgnoringModifiers:[initiatingEvent charactersIgnoringModifiers]
- isARepeat:[initiatingEvent isARepeat]
- keyCode:[initiatingEvent keyCode]];
- keyEvent(fakeEvent);
- }
- // FIXME: We should really get the current modifierFlags here, but there's no way to poll
- // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
- // no up-to-date cache of them anywhere.
- fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
- location:[[_bridge window] convertScreenToBase:[NSEvent mouseLocation]]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- eventNumber:0
- clickCount:0
- pressure:0];
- mouseMoved(fakeEvent);
-
+ if (eventType == NSLeftMouseDown || eventType == NSKeyDown) {
+ NSEvent *fakeEvent = nil;
+ if (eventType == NSLeftMouseDown) {
+ fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+ location:[initiatingEvent locationInWindow]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ eventNumber:[initiatingEvent eventNumber]
+ clickCount:[initiatingEvent clickCount]
+ pressure:[initiatingEvent pressure]];
+
+ mouseUp(fakeEvent);
+ }
+ else { // eventType == NSKeyDown
+ fakeEvent = [NSEvent keyEventWithType:NSKeyUp
+ location:[initiatingEvent locationInWindow]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ characters:[initiatingEvent characters]
+ charactersIgnoringModifiers:[initiatingEvent charactersIgnoringModifiers]
+ isARepeat:[initiatingEvent isARepeat]
+ keyCode:[initiatingEvent keyCode]];
+ keyEvent(fakeEvent);
+ }
+ // FIXME: We should really get the current modifierFlags here, but there's no way to poll
+ // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
+ // no up-to-date cache of them anywhere.
+ fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
+ location:[[_bridge window] convertScreenToBase:[NSEvent mouseLocation]]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ eventNumber:0
+ clickCount:0
+ pressure:0];
+ mouseMoved(fakeEvent);
+ }
+
KWQ_UNBLOCK_EXCEPTIONS;
}
More information about the webkit-changes
mailing list