Merge lp://qastaging/~afrantzis/unity-system-compositor/fix-1485737-notification-with-inactivity-zero into lp://qastaging/unity-system-compositor

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: 247
Merged at revision: 244
Proposed branch: lp://qastaging/~afrantzis/unity-system-compositor/fix-1485737-notification-with-inactivity-zero
Merge into: lp://qastaging/unity-system-compositor
Diff against target: 84 lines (+59/-0)
2 files modified
src/mir_screen.cpp (+10/-0)
tests/unit-tests/test_mir_screen.cpp (+49/-0)
To merge this branch: bzr merge lp://qastaging/~afrantzis/unity-system-compositor/fix-1485737-notification-with-inactivity-zero
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Terry (community) Approve
Mir development team Pending
Review via email: mp+268294@code.qastaging.launchpad.net

Commit message

Cancel active timeouts and ignore notification timeouts when inactivity timeouts are zero (LP: #1485737)

Description of the change

Cancel active timeouts and ignore notification timeouts when inactivity timeouts are zero (LP: #1485737)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Thanks for taking this branch over for me while I was EOD! :) Efficient.

Instead of directly comparing timeouts_inactivity (and making adding more timeout types even more complicated), might this be more generic if in the new "else" case we did:

else
{
   power_off_alarm->cancel();
   next_power_off = mir::time::Timestamp::max;
}

Instead of {}. This way, when a notification happens, the "new_next_power_off > next_power_off" check won't override the inactivity "never" timeout. But inactivity will still be turned off when the screen is manually turned off (as we do a next_power_off = {} when cancelling timers).

And of course the same for the dimmer logic.

Then we can drop all the extra if logic in this branch, I think?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
247. By Alexandros Frantzis

Simplify code based on mterry's suggestion

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> Then we can drop all the extra if logic in this branch, I think?

Good idea. Applied.

Revision history for this message
Michael Terry (mterry) wrote :

LGTM, but I'm not a Mir guy.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches