Blocking calls when setting brightness causing input events to queue.

Bug #1436363 reported by Nick Dedekind on 2015-03-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity System Compositor

Bug Description

The call to powerd which changes the brightness is synchronous, which is blocking the input events. This results in input events to wait in the queue until the call is completed.

Test case:
Brightness slider in the indicator lags behind while swiping around a lot.


Trial Resolution:
=== modified file 'src/powerd_mediator.cpp'
--- src/powerd_mediator.cpp 2014-09-17 09:44:55 +0000
+++ src/powerd_mediator.cpp 2015-03-25 14:20:00 +0000
@@ -195,7 +195,7 @@
     normal_brightness = brightness;

     if (backlight_state != BacklightState::automatic)
- powerd_interface->call("setUserBrightness", brightness);
+ powerd_interface->asyncCall("setUserBrightness", brightness);

I'm not sure about implications of changing to async calls though.

Alexandros Frantzis (afrantzis) wrote :

USC receives requests to change brightness through the Unity.Screen dbus interface. It then forwards the requests to powerd through dbus again.

If an application or system component doesn't care to wait for the "set brightness" request to complete, then it would be cleaner for that component to issue an async call to Unity.Screen.setBrightness, instead of forcing asynchronous behavior on everyone by changing USC.

Alexandros Frantzis (afrantzis) wrote :

Marking as "won't fix" since, as noted above, I don't think USC is the right place for this fix. If you think differently let's discuss and we can reopen accordingly.

Changed in unity-system-compositor:
status: New → Won't Fix
Alexandros Frantzis (afrantzis) wrote :

I misunderstood the problem. This is indeed a valid issue.

Changed in unity-system-compositor:
status: Won't Fix → Triaged
tags: added: pm-fail
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers