Merge lp:~albaguirre/unity-system-compositor/no-inactivity-handling-desktop into lp:unity-system-compositor

Proposed by Alberto Aguirre
Status: Merged
Approved by: Michael Terry
Approved revision: 154
Merged at revision: 149
Proposed branch: lp:~albaguirre/unity-system-compositor/no-inactivity-handling-desktop
Merge into: lp:unity-system-compositor
Diff against target: 105 lines (+30/-21)
4 files modified
CMakeLists.txt (+1/-1)
debian/control (+1/-1)
debian/unity-system-compositor.sleep (+1/-1)
src/system_compositor.cpp (+27/-18)
To merge this branch: bzr merge lp:~albaguirre/unity-system-compositor/no-inactivity-handling-desktop
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Robert Carr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+225537@code.launchpad.net

Commit message

Disable inactivity and power key handling for desktop. Fixes LP: #1337325

Description of the change

Disable inactivity and power key handling for desktop

Also:
Some version numbers were not updated
powerd is not needed on desktop so changed it to suggests instead of recommends

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
Robert Carr (robertcarr) wrote :

LGTM

review: Approve
153. By Alberto Aguirre

Make bool options consistent in use (i.e. avoid bool_switch)

154. By Alberto Aguirre

Undo version bump in replaces/breaks

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

LGTM

review: Approve
155. By Alberto Aguirre

Update command line since we are not using bool_switch anymore

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-05-06 20:06:27 +0000
3+++ CMakeLists.txt 2014-07-03 21:24:57 +0000
4@@ -18,7 +18,7 @@
5 set(PACKAGE "unity-system-compositor")
6 set(USC_VERSION_MAJOR 0)
7 set(USC_VERSION_MINOR 0)
8-set(USC_VERSION_PATCH 2)
9+set(USC_VERSION_PATCH 4)
10 set(USC_VERSION "${USC_VERSION_MAJOR}.${USC_VERSION_MINOR}.${USC_VERSION_PATCH}")
11
12 cmake_minimum_required(VERSION 2.8)
13
14=== modified file 'debian/control'
15--- debian/control 2014-06-27 00:49:05 +0000
16+++ debian/control 2014-07-03 21:24:57 +0000
17@@ -36,7 +36,7 @@
18 Architecture: any
19 Depends: ${misc:Depends},
20 ${shlibs:Depends},
21-Recommends: powerd,
22+Suggests: powerd,
23 Description: System compositor for Ubuntu
24 System compositor used by the Mir display server in Ubuntu. If the Unity
25 System Compositor can't start, LightDM will fallback to plain Xorg display
26
27=== modified file 'debian/unity-system-compositor.sleep'
28--- debian/unity-system-compositor.sleep 2013-08-28 07:28:30 +0000
29+++ debian/unity-system-compositor.sleep 2014-07-03 21:24:57 +0000
30@@ -1,4 +1,4 @@
31 #!/bin/sh
32
33 sleep .1
34-exec /usr/sbin/unity-system-compositor $@
35+exec /usr/sbin/unity-system-compositor --disable-inactivity-policy=true $@
36
37=== modified file 'src/system_compositor.cpp'
38--- src/system_compositor.cpp 2014-06-27 00:49:05 +0000
39+++ src/system_compositor.cpp 2014-07-03 21:24:57 +0000
40@@ -568,6 +568,11 @@
41 return the_options()->get("enable-hardware-cursor", false);
42 }
43
44+ bool disable_inactivity_policy()
45+ {
46+ return the_options()->get("disable-inactivity-policy", false);
47+ }
48+
49 std::string blacklist()
50 {
51 auto x = the_options()->get("blacklist", "");
52@@ -696,7 +701,8 @@
53 ("inactivity-display-off-timeout", po::value<int>(), "The time in seconds before the screen is turned off when there are no active sessions")
54 ("inactivity-display-dim-timeout", po::value<int>(), "The time in seconds before the screen is dimmed when there are no active sessions")
55 ("shutdown-timeout", po::value<int>(), "The time in milli-seconds the power key must be held to initiate a clean system shutdown")
56- ("power-key-ignore-timeout", po::value<int>(), "The time in milli-seconds the power key must be held to ignore - must be less than shutdown-timeout");
57+ ("power-key-ignore-timeout", po::value<int>(), "The time in milli-seconds the power key must be held to ignore - must be less than shutdown-timeout")
58+ ("disable-inactivity-policy", po::value<bool>(), "Disables handling user inactivity and power key");
59 }
60
61 void parse_config_file(
62@@ -857,23 +863,26 @@
63 {
64 QCoreApplication app(argc, argv);
65
66- std::chrono::seconds inactivity_display_off_timeout{config->inactivity_display_off_timeout()};
67- std::chrono::seconds inactivity_display_dim_timeout{config->inactivity_display_dim_timeout()};
68- std::chrono::milliseconds power_key_ignore_timeout{config->power_key_ignore_timeout()};
69- std::chrono::milliseconds shutdown_timeout{config->shutdown_timeout()};
70-
71- screen_state_handler = std::make_shared<ScreenStateHandler>(config,
72- std::chrono::duration_cast<std::chrono::milliseconds>(inactivity_display_off_timeout),
73- std::chrono::duration_cast<std::chrono::milliseconds>(inactivity_display_dim_timeout));
74-
75- power_key_handler = std::make_shared<PowerKeyHandler>(*(config->the_main_loop()),
76- power_key_ignore_timeout,
77- shutdown_timeout,
78- *screen_state_handler);
79-
80- auto composite_filter = config->the_composite_event_filter();
81- composite_filter->append(screen_state_handler);
82- composite_filter->append(power_key_handler);
83+ if (!config->disable_inactivity_policy())
84+ {
85+ std::chrono::seconds inactivity_display_off_timeout{config->inactivity_display_off_timeout()};
86+ std::chrono::seconds inactivity_display_dim_timeout{config->inactivity_display_dim_timeout()};
87+ std::chrono::milliseconds power_key_ignore_timeout{config->power_key_ignore_timeout()};
88+ std::chrono::milliseconds shutdown_timeout{config->shutdown_timeout()};
89+
90+ screen_state_handler = std::make_shared<ScreenStateHandler>(config,
91+ std::chrono::duration_cast<std::chrono::milliseconds>(inactivity_display_off_timeout),
92+ std::chrono::duration_cast<std::chrono::milliseconds>(inactivity_display_dim_timeout));
93+
94+ power_key_handler = std::make_shared<PowerKeyHandler>(*(config->the_main_loop()),
95+ power_key_ignore_timeout,
96+ shutdown_timeout,
97+ *screen_state_handler);
98+
99+ auto composite_filter = config->the_composite_event_filter();
100+ composite_filter->append(screen_state_handler);
101+ composite_filter->append(power_key_handler);
102+ }
103
104 ensure_spinner();
105 app.exec();

Subscribers

People subscribed via source and target branches