aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-10-26 14:10:27 +0200
committerDrew DeVault <sir@cmpwn.com>2019-10-27 10:49:53 -0400
commit9971db02ff044da6cf105a7f1d0ede1ea740c3fd (patch)
tree2fd5dc96c4f674bcec84e8ef308e8d6720364044
parent0e57effd38d4566d6245d8b9f985c5af923472f3 (diff)
output-management-v1: add assertion as a safety net
Makes it easier to figure out when the compositor submits an invalid output state. References: https://github.com/swaywm/sway/pull/4673
-rw-r--r--types/wlr_output_management_v1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types/wlr_output_management_v1.c b/types/wlr_output_management_v1.c
index 6f968a63..9f4b9af1 100644
--- a/types/wlr_output_management_v1.c
+++ b/types/wlr_output_management_v1.c
@@ -686,6 +686,9 @@ static void head_send_state(struct wlr_output_head_v1 *head,
}
if (state & HEAD_STATE_MODE) {
+ assert(head->state.mode != NULL ||
+ wl_list_empty(&head->state.output->modes));
+
bool found = false;
struct wl_resource *mode_resource;
wl_resource_for_each(mode_resource, &head->mode_resources) {