I have found a way to deterministically reproduce the issue with
webbrowser-app. Perhaps there are other scenarios that are problematic,
but hopefully this will at least provide some hints. Below are the steps
and between them the USC logs I get for each step, which give some
insight into what is going wrong.

[TL;DR]

The problem seems to be that, for some reason, if after the screen is
turned on and logging in the webbrowser is in focus and playing a video
(which means that the user previously turned off the screen with the
power button while playing a video in the browser) the webbrowser app
leaks (doesn't eventually release) two keepDisplayOn requests ids. This
causes the screen to stay on even when focusing away from it.

[Detailed analysis]

1.  Start browser, start watching a youtube video. The browser requests
keepDisplayOn twice from two different dbus connections, which is
strange, but OK.

[1444841076.023016] usc::UnityScreenService: Received request with serial 3 
from :1.300 : keepDisplayOn 
[1444841076.023390] usc::UnityScreenService: Sending reply for serial 3 to 
:1.300 id: 9 
[1444841077.052913] usc::UnityScreenService: Received request with serial 3 
from :1.301 : keepDisplayOn 
[1444841077.053164] usc::UnityScreenService: Sending reply for serial 3 to 
:1.301 id: 10

2. Turn off screen with power key. Everything is normal the
keepDisplayOn requests are released.

[1444841087.268477] usc::UnityScreenService: Received request with serial 4 
from :1.300 : removeDisplayOnRequest id: 9 
[1444841087.274530] usc::UnityScreenService: Received request with serial 4 
from :1.301 : removeDisplayOnRequest id: 10 

3.  Turn on screen with power key, log in, video should resume. Strange
things happen here, note the extra keepDisplayOn requests this time (4
vs 2 before, and they are all from webbrowser-app)

[1444841106.885474] usc::UnityScreenService: Received request with serial 3 
from :1.302 : keepDisplayOn 
[1444841106.885997] usc::UnityScreenService: Sending reply for serial 3 to 
:1.302 id: 11 
[1444841106.889124] usc::UnityScreenService: Received request with serial 3 
from :1.303 : keepDisplayOn 
[1444841106.889333] usc::UnityScreenService: Sending reply for serial 3 to 
:1.303 id: 12 
[1444841106.895151] usc::UnityScreenService: Received request with serial 3 
from :1.304 : keepDisplayOn 
[1444841106.895258] usc::UnityScreenService: Sending reply for serial 3 to 
:1.304 id: 13 
[1444841106.900406] usc::UnityScreenService: Received request with serial 3 
from :1.305 : keepDisplayOn 
[1444841106.900471] usc::UnityScreenService: Sending reply for serial 3 to 
:1.305 id: 14

4. Focus away from webbrowser (e.g. go to scopes). webbrowser-app
requested 4 keepDisplayOn ids but releases only 2, which causes the
screen to stay on.

[1444841117.298103] usc::UnityScreenService: Received request with serial 4 
from :1.304 : removeDisplayOnRequest id: 13 
[1444841117.307436] usc::UnityScreenService: Received request with serial 4 
from :1.305 : removeDisplayOnRequest id: 14

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1502145

Title:
  Apps can keep screen lit permanently

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1502145/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to