Merge lp:~uriboni/webbrowser-app/dont-lose-fullscreen-on-volume into lp:webbrowser-app

Proposed by Ugo Riboni on 2015-07-30
Status: Merged
Approved by: Olivier Tilloy on 2015-08-13
Approved revision: 1110
Merged at revision: 1135
Proposed branch: lp:~uriboni/webbrowser-app/dont-lose-fullscreen-on-volume
Merge into: lp:webbrowser-app
Diff against target: 43 lines (+15/-3)
1 file modified
src/app/webbrowser/Browser.qml (+15/-3)
To merge this branch: bzr merge lp:~uriboni/webbrowser-app/dont-lose-fullscreen-on-volume
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-08-14
Olivier Tilloy 2015-07-30 Approve on 2015-08-10
Review via email: mp+266437@code.launchpad.net

Commit Message

Delay the exit from fullscreen mode until focus remains lost for a certain amount of time.

Description of the Change

Delay the exit from fullscreen mode until focus remains lost for a certain amount of time.

To post a comment you must log in.
Olivier Tilloy (osomon) wrote :

This workaround does the job. However, as commented in bug #1477308, the root cause of the issue is in notify-osd itself that briefly steals focus from the app, so if possible I’d rather have the issue properly fixed than worked around.

A comment on the comment:

> // We prevent this by removing focus only if the focus remain lost for

I guess you mean "we prevent this by leaving fullscreen only if …"

1109. By Ugo Riboni on 2015-08-10

Reword comment so that it is more clear what is going on. Remove unnecessary trailing whitespace while we are at it.

1110. By Ugo Riboni on 2015-08-10

Merge changes from trunk

Olivier Tilloy (osomon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2015-07-09 20:27:09 +0000
3+++ src/app/webbrowser/Browser.qml 2015-08-10 14:47:25 +0000
4@@ -1105,7 +1105,7 @@
5 PopupUtils.open(bookmarkOptionsComponent,
6 chrome.bookmarkTogglePlaceHolder,
7 {"bookmarkUrl": url,
8- "bookmarkTitle": title})
9+ "bookmarkTitle": title})
10 }
11 }
12
13@@ -1204,6 +1204,13 @@
14 running: !browser.incognito
15 onTriggered: delayedSessionSaver.restart()
16 }
17+ Timer {
18+ id: exitFullscreenOnLostFocus
19+ interval: 500
20+ onTriggered: {
21+ if (browser.currentWebview) browser.currentWebview.fullscreen = false
22+ }
23+ }
24 Connections {
25 target: Qt.application
26 onStateChanged: {
27@@ -1212,9 +1219,14 @@
28 session.save()
29 }
30 if (browser.currentWebview) {
31- browser.currentWebview.fullscreen = false
32+ // Workaround for a desktop bug where changing volume causes the app to
33+ // briefly lose focus to notify-osd, and therefore exit fullscreen mode.
34+ // We prevent this by exiting fullscreen only if the focus remains lost
35+ // for longer than a certain threshold. See: http://pad.lv/1477308
36+ if (formFactor == "desktop") exitFullscreenOnLostFocus.start()
37+ else browser.currentWebview.fullscreen = false
38 }
39- }
40+ } else exitFullscreenOnLostFocus.stop()
41 }
42 onAboutToQuit: {
43 if (!browser.incognito) {

Subscribers

People subscribed via source and target branches

to status/vote changes: