Merge lp:~mterry/powerd/consistent-state into lp:powerd

Proposed by Michael Terry
Status: Merged
Approved by: Oliver Grawert
Approved revision: 125
Merged at revision: 125
Proposed branch: lp:~mterry/powerd/consistent-state
Merge into: lp:powerd
Diff against target: 69 lines (+8/-5)
4 files modified
src/display-request.c (+0/-1)
src/display.c (+2/-0)
src/powerd-internal.h (+2/-1)
src/powerd-object.c (+4/-3)
To merge this branch: bzr merge lp:~mterry/powerd/consistent-state
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
Oliver Grawert Approve
PS Jenkins bot continuous-integration Approve
Alberto Aguirre Pending
Review via email: mp+215761@code.launchpad.net

Commit message

Emit display state changed signals any time state changes, not just when requested state changes.

Description of the change

Emit display state changed signals any time state changes, not just when requested state changes.

Without this, we don't emit a changed signal on power button presses if we have an existing display-on request. Which was stopping autopilot from being able to lock unity8 by simulating a power button press (jenkins keeps screen from timing out with powerd-cli, unity8 listens for the display state changed signal to lock).

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
Oliver Grawert (ogra) wrote :

i see no ill effects with that patch applied, approving

review: Approve
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Code if fine, and works as expected, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/display-request.c'
2--- src/display-request.c 2013-08-12 04:45:17 +0000
3+++ src/display-request.c 2014-04-14 21:20:04 +0000
4@@ -78,7 +78,6 @@
5 new_state.state, new_state.flags);
6 internal_state = new_state;
7 powerd_set_display_state(&internal_state);
8- powerd_display_state_signal_emit(&internal_state);
9 }
10
11 static void __add_request(struct powerd_display_request *req)
12
13=== modified file 'src/display.c'
14--- src/display.c 2014-03-28 21:30:25 +0000
15+++ src/display.c 2014-04-14 21:20:04 +0000
16@@ -270,6 +270,8 @@
17 }
18
19 actual_screen_state = applied_state;
20+
21+ powerd_display_state_signal_emit(actual_screen_state, req->flags);
22 }
23
24 static void update_flags(guint32 flags)
25
26=== modified file 'src/powerd-internal.h'
27--- src/powerd-internal.h 2014-03-26 12:36:15 +0000
28+++ src/powerd-internal.h 2014-04-14 21:20:04 +0000
29@@ -140,7 +140,8 @@
30 enum SysPowerStates current_system_power_state(void);
31 const gchar * state_to_string(int state);
32 void powerd_sys_state_signal_emit(enum SysPowerStates state);
33-void powerd_display_state_signal_emit(struct powerd_display_request *req);
34+void powerd_display_state_signal_emit(enum powerd_display_state state,
35+ guint32 flags);
36 void clear_sys_state_by_owner(const char *owner);
37 gboolean powerd_suspend_active(void);
38
39
40=== modified file 'src/powerd-object.c'
41--- src/powerd-object.c 2014-03-26 12:36:15 +0000
42+++ src/powerd-object.c 2014-04-14 21:20:04 +0000
43@@ -234,7 +234,8 @@
44 }
45
46 void
47-powerd_display_state_signal_emit(struct powerd_display_request *req)
48+powerd_display_state_signal_emit(enum powerd_display_state state,
49+ guint32 flags)
50 {
51 GError *error = NULL;
52
53@@ -243,14 +244,14 @@
54 return;
55
56 powerd_debug("Emitting signal for display state change: state=%d flags=0x%08x",
57- req->state, req->flags);
58+ state, flags);
59 g_dbus_connection_emit_signal(
60 POWERD_SOURCE_GET_PRIVATE(powerd_source)->system_bus,
61 NULL, /* destination */
62 "/com/canonical/powerd",
63 "com.canonical.powerd",
64 "DisplayPowerStateChange",
65- g_variant_new("(iu)", req->state, req->flags),
66+ g_variant_new("(iu)", state, flags),
67 &error);
68 if (error) {
69 powerd_warn("Unable to signal a state change update: %s", error->message);

Subscribers

People subscribed via source and target branches