Bug 96997

Summary: [Qt][WK2] Focus out is not handled properly
Product: WebKit Reporter: Heikki Paajanen <hepaajan>
Component: New BugsAssignee: Michael Brüning <michael.bruning>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, allan.jensen, cmarcelo, menard, michael.bruning, pnormand, webkit.review.bot, zoltan
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Heikki Paajanen
Reported 2012-09-18 03:56:46 PDT
When (qml) WebView looses focus the focus status is not updated correctly to WebProcess. QtWebPageEventHandler::handleFocusOutEvent calls WebPageProxy::viewStateDidChange which then checks the focus from QtPageClient::isViewFocused. QtPageClient::isViewFocused returns QQuickWebView::hasFocus but the actual "focus" property value has not changed yet and thus it returns true. This can be seen e.g. in MiniBrowser by clicking address bar after launching as the caret is left blinking on google search front page text input.
Attachments
Patch (4.43 KB, patch)
2012-09-21 08:37 PDT, Michael Brüning
no flags
Patch (2.56 KB, patch)
2012-09-24 07:36 PDT, Michael Brüning
no flags
Patch (2.59 KB, patch)
2012-09-25 01:55 PDT, Michael Brüning
no flags
Patch (4.47 KB, patch)
2012-09-25 05:40 PDT, Michael Brüning
no flags
Michael Brüning
Comment 1 2012-09-19 08:58:17 PDT
I'll check this.
Michael Brüning
Comment 2 2012-09-21 08:37:01 PDT
Michael Brüning
Comment 3 2012-09-21 08:38:09 PDT
The solution here might be a bit "hacky", but it seems to be the least complicated way. Better suggestions are welcome as always :)
Allan Sandfeld Jensen
Comment 4 2012-09-21 09:39:07 PDT
Would it possible to set the focus value on the UIProcess side as soon as the event is send to the WebProcess? Focus out shouldn't be an event the WebProcess can block anyway.
Michael Brüning
Comment 5 2012-09-24 07:31:11 PDT
(In reply to comment #4) > Would it possible to set the focus value on the UIProcess side as soon as the event is send to the WebProcess? Focus out shouldn't be an event the WebProcess can block anyway. It's not really the WebProcess "blocking" the focus, it's the UI process feeding it with the wrong value and hence the FocusController doesn't set the focus on the text element correctly. Anyway, after digging through the focus event handling etc, I have found that virtual void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value); is the right method to override here as also e.g. the QQuickTextInput uses that for deciding about lost focus (gaining focus seems to work...). Updated patch coming soon...
Michael Brüning
Comment 6 2012-09-24 07:36:55 PDT
Michael Brüning
Comment 7 2012-09-24 08:11:20 PDT
As already correctly noted by Simon on irc, the call to QQuickItem::itemChange() will be changed to QQuickFlickable::itemChange().
Michael Brüning
Comment 8 2012-09-25 01:55:54 PDT
Michael Brüning
Comment 9 2012-09-25 05:40:35 PDT
WebKit Review Bot
Comment 10 2012-09-25 06:16:05 PDT
Comment on attachment 165592 [details] Patch Clearing flags on attachment: 165592 Committed r129496: <http://trac.webkit.org/changeset/129496>
WebKit Review Bot
Comment 11 2012-09-25 06:16:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.