Merge ~osomon/oxide:powersaveblocker-unity8 into oxide:master

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 71f4925db74609be3e33dc536858b57dc7e41bff
Proposed branch: ~osomon/oxide:powersaveblocker-unity8
Merge into: oxide:master
Diff against target: 33 lines (+7/-10)
1 file modified
shared/browser/device/power_save_blocker_linux.cc (+7/-10)
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+312647@code.launchpad.net

Commit message

Instantiate the correct PowerSaveBlocker implementation on Unity8 (LP: #1647895).

To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks, I've left some comments inline

review: Needs Fixing
a96fc1f... by Olivier Tilloy

Address review comments.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the review. All your comments should be addressed now.

Revision history for this message
Chris Coulson (chrisccoulson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/shared/browser/device/power_save_blocker_linux.cc b/shared/browser/device/power_save_blocker_linux.cc
2index 1a3cac1..783cc53 100644
3--- a/shared/browser/device/power_save_blocker_linux.cc
4+++ b/shared/browser/device/power_save_blocker_linux.cc
5@@ -43,22 +43,19 @@ std::unique_ptr<PowerSaveBlocker> PowerSaveBlocker::Create(
6 case base::nix::DESKTOP_ENVIRONMENT_GNOME:
7 case base::nix::DESKTOP_ENVIRONMENT_KDE4:
8 case base::nix::DESKTOP_ENVIRONMENT_KDE5:
9- case base::nix::DESKTOP_ENVIRONMENT_UNITY:
10 case base::nix::DESKTOP_ENVIRONMENT_XFCE:
11- // FIXME: Unity and Gnome don't support the FDO interface
12+ // FIXME: Gnome doesn't support the FDO interface
13 return base::MakeUnique<PowerSaveBlockerFDO>(type, description);
14- case base::nix::DESKTOP_ENVIRONMENT_OTHER: {
15- // This is kind of hacky - there's no way to identify that we're running on
16- // Unity 8, so we just assume that we are if QT_QPA_PLATFORM is set to
17- // "ubuntumirclient"
18- std::string qt_qpa_platform;
19- if (env->GetVar("QT_QPA_PLATFORM", &qt_qpa_platform) &&
20- qt_qpa_platform == "ubuntumirclient") {
21+ case base::nix::DESKTOP_ENVIRONMENT_UNITY: {
22+ std::string xdg_session_type;
23+ if (env->GetVar("XDG_SESSION_TYPE", &xdg_session_type) &&
24+ xdg_session_type == "mir") {
25 return base::MakeUnique<PowerSaveBlockerUnity8>();
26 }
27- return nullptr;
28+ return base::MakeUnique<PowerSaveBlockerFDO>(type, description);
29 }
30 case base::nix::DESKTOP_ENVIRONMENT_KDE3:
31+ case base::nix::DESKTOP_ENVIRONMENT_OTHER:
32 return nullptr;
33 }
34

Subscribers

People subscribed via source and target branches