Commit 358180db authored by darin's avatar darin
Browse files

Reviewed by Trey and Ken.

	- fixed 3125613 -- REGRESSION: resizing frames after clicking on scroll bar doesn't work right

        The problem was that the mouse dragged events were going to the scroll bar because the new click
        on the frame resizer didn't fall into the code path that sets _mouseDownView.

        * kwq/KWQKHTMLPart.h: Add override of khtmlMouseMoveEvent.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Don't set _mouseDownView. This is now handled
	at the higher level when the mouseDown comes in.
        (KWQKHTMLPart::khtmlMouseMoveEvent): Added. Pass along mouseDragged: events. I didn't have this
	before because I don't want or need to pass mouseMoved: events along, but the KHTML mouse move
	event corresponds to both AppKit mouseDragged and mouseMoved.
        (KWQKHTMLPart::khtmlMouseReleaseEvent): Don't clear _mouseDownView. This is now handled at the
	higher level when the mouseUp comes in.
        (KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
        (KWQKHTMLPart::mouseDown): Set _mouseDownView to nil; it will be set by passWidgetMouseDownEventToWidget
	if we end up passing the event down. This is the change that actually fixes the bug mentioned above.
        (KWQKHTMLPart::mouseUp): Set _mouseDownView to nil after handling the mouseUp. It's OK if we don't
	clear this out in cases where we don't get a mouseUp event -- we'll get a mouseDown later -- but it's
	still probably a good idea to clear it when we know the mouse is no longer down.

	- used update-kwq-assert to update the code that's a shared copy of WebFoundation code

        * kwq/KWQAssertions.m: (vprintf_stderr_objc): Got the UTF-8 fix I did a while back.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4c01c7d1
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Trey and Ken.
- fixed 3125613 -- REGRESSION: resizing frames after clicking on scroll bar doesn't work right
The problem was that the mouse dragged events were going to the scroll bar because the new click
on the frame resizer didn't fall into the code path that sets _mouseDownView.
* kwq/KWQKHTMLPart.h: Add override of khtmlMouseMoveEvent.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Don't set _mouseDownView. This is now handled
at the higher level when the mouseDown comes in.
(KWQKHTMLPart::khtmlMouseMoveEvent): Added. Pass along mouseDragged: events. I didn't have this
before because I don't want or need to pass mouseMoved: events along, but the KHTML mouse move
event corresponds to both AppKit mouseDragged and mouseMoved.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Don't clear _mouseDownView. This is now handled at the
higher level when the mouseUp comes in.
(KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
(KWQKHTMLPart::mouseDown): Set _mouseDownView to nil; it will be set by passWidgetMouseDownEventToWidget
if we end up passing the event down. This is the change that actually fixes the bug mentioned above.
(KWQKHTMLPart::mouseUp): Set _mouseDownView to nil after handling the mouseUp. It's OK if we don't
clear this out in cases where we don't get a mouseUp event -- we'll get a mouseDown later -- but it's
still probably a good idea to clear it when we know the mouse is no longer down.
- used update-kwq-assert to update the code that's a shared copy of WebFoundation code
* kwq/KWQAssertions.m: (vprintf_stderr_objc): Got the UTF-8 fix I did a while back.
2002-12-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Trey and Ken.
- fixed 3125613 -- REGRESSION: resizing frames after clicking on scroll bar doesn't work right
The problem was that the mouse dragged events were going to the scroll bar because the new click
on the frame resizer didn't fall into the code path that sets _mouseDownView.
* kwq/KWQKHTMLPart.h: Add override of khtmlMouseMoveEvent.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Don't set _mouseDownView. This is now handled
at the higher level when the mouseDown comes in.
(KWQKHTMLPart::khtmlMouseMoveEvent): Added. Pass along mouseDragged: events. I didn't have this
before because I don't want or need to pass mouseMoved: events along, but the KHTML mouse move
event corresponds to both AppKit mouseDragged and mouseMoved.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Don't clear _mouseDownView. This is now handled at the
higher level when the mouseUp comes in.
(KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
(KWQKHTMLPart::mouseDown): Set _mouseDownView to nil; it will be set by passWidgetMouseDownEventToWidget
if we end up passing the event down. This is the change that actually fixes the bug mentioned above.
(KWQKHTMLPart::mouseUp): Set _mouseDownView to nil after handling the mouseUp. It's OK if we don't
clear this out in cases where we don't get a mouseUp event -- we'll get a mouseDown later -- but it's
still probably a good idea to clear it when we know the mouse is no longer down.
- used update-kwq-assert to update the code that's a shared copy of WebFoundation code
* kwq/KWQAssertions.m: (vprintf_stderr_objc): Got the UTF-8 fix I did a while back.
2002-12-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......
......@@ -32,7 +32,7 @@ static void vprintf_stderr_objc(const char *format, va_list args)
if (!strstr(format, "%@")) {
vfprintf_no_warning(stderr, format, args);
} else {
fputs([[[[NSString alloc] initWithFormat:[NSString stringWithCString:format] arguments:args] autorelease] lossyCString], stderr);
fputs([[[[NSString alloc] initWithFormat:[NSString stringWithCString:format] arguments:args] autorelease] UTF8String], stderr);
}
}
......
......@@ -162,6 +162,7 @@ public:
private:
virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
virtual void khtmlMouseMoveEvent(khtml::MouseMoveEvent *);
virtual void khtmlMouseReleaseEvent(khtml::MouseReleaseEvent *);
static int buttonForCurrentEvent();
......
......@@ -56,6 +56,7 @@ using khtml::Cache;
using khtml::ChildFrame;
using khtml::Decoder;
using khtml::MouseDoubleClickEvent;
using khtml::MouseMoveEvent;
using khtml::MousePressEvent;
using khtml::MouseReleaseEvent;
using khtml::RenderObject;
......@@ -740,8 +741,6 @@ void KWQKHTMLPart::khtmlMouseDoubleClickEvent(MouseDoubleClickEvent *event)
bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(khtml::MouseEvent *event)
{
_mouseDownView = nil;
// Figure out which view to send the event to.
RenderObject *target = event->innerNode().handle()->renderer();
if (!target || !target->isWidget()) {
......@@ -752,8 +751,6 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(khtml::MouseEvent *event)
bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(RenderWidget *renderWidget)
{
_mouseDownView = nil;
NSView *nodeView = renderWidget->widget()->getView();
ASSERT(nodeView);
ASSERT([nodeView superview]);
......@@ -780,6 +777,18 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(RenderWidget *renderWidget)
return true;
}
void KWQKHTMLPart::khtmlMouseMoveEvent(MouseMoveEvent *event)
{
if (!_mouseDownView || [_currentEvent type] != NSLeftMouseDragged) {
KHTMLPart::khtmlMouseMoveEvent(event);
return;
}
_sendingEventToSubview = true;
[_mouseDownView mouseDragged:_currentEvent];
_sendingEventToSubview = false;
}
void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
{
if (!_mouseDownView) {
......@@ -790,7 +799,6 @@ void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
_sendingEventToSubview = true;
[_mouseDownView mouseUp:_currentEvent];
_sendingEventToSubview = false;
_mouseDownView = nil;
}
void KWQKHTMLPart::widgetWillReleaseView(NSView *view)
......@@ -840,7 +848,6 @@ bool KWQKHTMLPart::passSubframeEventToSubframe(DOM::NodeImpl::MouseEvent &event)
_sendingEventToSubview = true;
[_mouseDownView mouseUp:_currentEvent];
_sendingEventToSubview = false;
_mouseDownView = nil;
return true;
case NSLeftMouseDragged:
if (!(_mouseDownView && _mouseDownWasInSubframe)) {
......@@ -897,6 +904,8 @@ void KWQKHTMLPart::mouseDown(NSEvent *event)
return;
}
_mouseDownView = nil;
NSEvent *oldCurrentEvent = _currentEvent;
_currentEvent = event;
......@@ -948,6 +957,8 @@ void KWQKHTMLPart::mouseUp(NSEvent *event)
}
_currentEvent = oldCurrentEvent;
_mouseDownView = nil;
}
void KWQKHTMLPart::mouseMoved(NSEvent *event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment