diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-12-01 15:32:14 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-12-01 23:27:22 +0100 |
commit | aa03a8fcb54a89752d154605c4b6064c84c9be44 (patch) | |
tree | b6b951044727d9a4c42c9ec650fa7eb327462934 /sway/desktop | |
parent | 3bd657c7260b949019361da3f87aa5a264721ba2 (diff) |
sway/desktop/output: listen to output mode in commit handle
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 6999a382..f39b8ea7 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -805,7 +805,6 @@ static void handle_destroy(struct wl_listener *listener, void *data) { wl_list_remove(&output->destroy.link); wl_list_remove(&output->commit.link); - wl_list_remove(&output->mode.link); wl_list_remove(&output->present.link); wl_list_remove(&output->damage.link); wl_list_remove(&output->frame.link); @@ -822,8 +821,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { update_output_manager_config(server); } -static void handle_mode(struct wl_listener *listener, void *data) { - struct sway_output *output = wl_container_of(listener, output, mode); +static void handle_mode(struct sway_output *output) { if (!output->enabled && !output->enabling) { struct output_config *oc = find_output_config(output); if (output->wlr_output->current_mode != NULL && @@ -862,6 +860,10 @@ static void handle_commit(struct wl_listener *listener, void *data) { struct sway_output *output = wl_container_of(listener, output, commit); struct wlr_output_event_commit *event = data; + if (event->committed & WLR_OUTPUT_STATE_MODE) { + handle_mode(output); + } + if (!output->enabled) { return; } @@ -954,8 +956,6 @@ void handle_new_output(struct wl_listener *listener, void *data) { output->destroy.notify = handle_destroy; wl_signal_add(&wlr_output->events.commit, &output->commit); output->commit.notify = handle_commit; - wl_signal_add(&wlr_output->events.mode, &output->mode); - output->mode.notify = handle_mode; wl_signal_add(&wlr_output->events.present, &output->present); output->present.notify = handle_present; wl_signal_add(&wlr_output->events.damage, &output->damage); |