Commit 2e80479f authored by darin's avatar darin

Reviewed by Trey.

	- fixed regression where clicked-on buttons were getting keyboard focus

        * kwq/KWQKHTMLPart.mm:
	(KWQKHTMLPart::khtmlMousePressEvent): Check clickCount here the way NSWindow does.
	See below for rationale.
	(KWQKHTMLPart::passWidgetMouseDownEventToWidget): I didn't read the code in
	[NSWindow sendEvent:] that I was stealing carefully enough. The old needsPanelToBecomeKey
	flag is used to decide whether something should really get first responder, and I need to
	do check that too. And while I was in here, did the same clickCount check that NSWindow
	does for good measure.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4d93d495
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed regression where clicked-on buttons were getting keyboard focus
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMousePressEvent): Check clickCount here the way NSWindow does.
See below for rationale.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): I didn't read the code in
[NSWindow sendEvent:] that I was stealing carefully enough. The old needsPanelToBecomeKey
flag is used to decide whether something should really get first responder, and I need to
do check that too. And while I was in here, did the same clickCount check that NSWindow
does for good measure.
2002-12-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......@@ -37,7 +52,6 @@
2002-12-15 David Hyatt <hyatt@apple.com>
>>>>>>> 1.1128
Fix for 3109226, epinions page is mostly blank. Add a hack
to disallow > but only inside attribute values for which there
is no corresponding attribute name.
......
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed regression where clicked-on buttons were getting keyboard focus
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMousePressEvent): Check clickCount here the way NSWindow does.
See below for rationale.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): I didn't read the code in
[NSWindow sendEvent:] that I was stealing carefully enough. The old needsPanelToBecomeKey
flag is used to decide whether something should really get first responder, and I need to
do check that too. And while I was in here, did the same clickCount check that NSWindow
does for good measure.
2002-12-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......@@ -37,7 +52,6 @@
2002-12-15 David Hyatt <hyatt@apple.com>
>>>>>>> 1.1128
Fix for 3109226, epinions page is mostly blank. Add a hack
to disallow > but only inside attribute values for which there
is no corresponding attribute name.
......
......@@ -724,11 +724,11 @@ bool KWQKHTMLPart::closeURL()
void KWQKHTMLPart::khtmlMousePressEvent(MousePressEvent *event)
{
if (!passWidgetMouseDownEventToWidget(event)) {
// We don't do this at the start of mouse down handling, because we don't want to do it until
// we know we didn't hit a widget.
// We don't do this at the start of mouse down handling (before calling into WebCore),
// because we don't want to do it until we know we didn't hit a widget.
NSView *view = d->m_view->getDocumentView();
NSWindow *window = [view window];
if ([window firstResponder] != view) {
if ([_currentEvent clickCount] <= 1 && [window firstResponder] != view) {
[window makeFirstResponder:view];
}
......@@ -790,7 +790,7 @@ bool KWQKHTMLPart::passWidgetMouseDownEventToWidget(RenderWidget *renderWidget)
} else {
// Normally [NSWindow sendEvent:] handles setting the first responder.
// But in our case, the event was sent to the view representing the entire web page.
if ([view acceptsFirstResponder]) {
if ([_currentEvent clickCount] <= 1 && [view acceptsFirstResponder] && [view needsPanelToBecomeKey]) {
[window makeFirstResponder:view];
}
}
......
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