Merge lp:~michael-sheldon/oxide/input-focus-fix into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Michael Sheldon
Status: Merged
Merged at revision: 627
Proposed branch: lp:~michael-sheldon/oxide/input-focus-fix
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 16 lines (+6/-0)
1 file modified
qt/core/browser/oxide_qt_render_widget_host_view.cc (+6/-0)
To merge this branch: bzr merge lp:~michael-sheldon/oxide/input-focus-fix
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+224587@code.launchpad.net

Commit message

Force Qt focus object changed events when the oxide focused node changes

Description of the change

Works around bug #1323743. After launching the browser via a call to Qt.openExternalUrl() from inside a webapp (e.g. by clicking a link in twitter) and then returning to the webapp, the keyboard stops appearing because the setFocusObject() method is no longer being called on the QInputContext (which is done internally by QGuiApplication). I'm still not clear on why this is the case, but this branch at least provides a work around by explicitly triggering a focus object changed event.

To post a comment you must log in.
583. By Michael Sheldon

Merge from trunk

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qt/core/browser/oxide_qt_render_widget_host_view.cc'
2--- qt/core/browser/oxide_qt_render_widget_host_view.cc 2014-06-26 08:49:22 +0000
3+++ qt/core/browser/oxide_qt_render_widget_host_view.cc 2014-06-26 11:07:37 +0000
4@@ -817,6 +817,12 @@
5 if (!HasFocus()) {
6 return;
7 }
8+
9+ // Work around for https://launchpad.net/bugs/1323743
10+ if(QGuiApplication::focusWindow() && QGuiApplication::focusWindow()->focusObject()) {
11+ QGuiApplication::focusWindow()->focusObjectChanged(QGuiApplication::focusWindow()->focusObject());
12+ }
13+
14 delegate_->SetInputMethodEnabled(is_editable_node);
15 if (QGuiApplication::inputMethod()->isVisible() != is_editable_node) {
16 QGuiApplication::inputMethod()->setVisible(is_editable_node);

Subscribers

People subscribed via source and target branches