Codebase list wlroots / c95d2e9
output-management-v1: send complete head state on enable change Fixes a phosh crash when the compositor fails to send updated state. Guido Günther 3 years ago
2 changed file(s) with 32 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From: Roman Gilg <subdiff@gmail.com>
1 Date: Thu, 1 Oct 2020 14:32:57 +0200
2 Subject: output-management-v1: send complete head state on enable change
3
4 The data of a head is only sent when it is enabled. While the head was disabled
5 data might have been changed. In this case clients were not informed about this
6 change. A later enable change that does not also update the other data must
7 still lead to the propagation of this data.
8
9 Since we do not know what other data was changed while the head was disabled
10 just send together with an enable change all current data.
11
12 (cherry picked from commit 86c0b9986b82a477dea7e6029c0fe565dd7af429)
13 ---
14 types/wlr_output_management_v1.c | 3 +++
15 1 file changed, 3 insertions(+)
16
17 diff --git a/types/wlr_output_management_v1.c b/types/wlr_output_management_v1.c
18 index 15a971f..06d1ce4 100644
19 --- a/types/wlr_output_management_v1.c
20 +++ b/types/wlr_output_management_v1.c
21 @@ -680,6 +680,9 @@ static void head_send_state(struct wlr_output_head_v1 *head,
22
23 if (state & HEAD_STATE_ENABLED) {
24 zwlr_output_head_v1_send_enabled(head_resource, head->state.enabled);
25 + // On enabling we send all current data since clients have not been
26 + // notified about potential data changes while the head was disabled.
27 + state = HEAD_STATE_ALL;
28 }
29
30 if (!head->state.enabled) {
0 output-management-v1-send-complete-head-state-on-enable-c.patch