Skip to content

Commit

Permalink
output-management-v1: add assertion as a safety net
Browse files Browse the repository at this point in the history
Makes it easier to figure out when the compositor submits an invalid
output state.

References: swaywm/sway#4673
  • Loading branch information
emersion authored and aiqs4 committed Dec 19, 2019
1 parent ff96228 commit ec6b887
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/wlr_output_management_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ec6b887

Please sign in to comment.