aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-12-01 15:32:14 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2022-12-01 23:27:22 +0100
commitaa03a8fcb54a89752d154605c4b6064c84c9be44 (patch)
treeb6b951044727d9a4c42c9ec650fa7eb327462934 /sway
parentChase breaking changes in wlroots!3903 (diff)
downloadsway-aa03a8fcb54a89752d154605c4b6064c84c9be44.tar.gz
sway-aa03a8fcb54a89752d154605c4b6064c84c9be44.tar.zst
sway-aa03a8fcb54a89752d154605c4b6064c84c9be44.zip
sway/desktop/output: listen to output mode in commit handle
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/output.c10
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) {
805 805
806 wl_list_remove(&output->destroy.link); 806 wl_list_remove(&output->destroy.link);
807 wl_list_remove(&output->commit.link); 807 wl_list_remove(&output->commit.link);
808 wl_list_remove(&output->mode.link);
809 wl_list_remove(&output->present.link); 808 wl_list_remove(&output->present.link);
810 wl_list_remove(&output->damage.link); 809 wl_list_remove(&output->damage.link);
811 wl_list_remove(&output->frame.link); 810 wl_list_remove(&output->frame.link);
@@ -822,8 +821,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
822 update_output_manager_config(server); 821 update_output_manager_config(server);
823} 822}
824 823
825static void handle_mode(struct wl_listener *listener, void *data) { 824static void handle_mode(struct sway_output *output) {
826 struct sway_output *output = wl_container_of(listener, output, mode);
827 if (!output->enabled && !output->enabling) { 825 if (!output->enabled && !output->enabling) {
828 struct output_config *oc = find_output_config(output); 826 struct output_config *oc = find_output_config(output);
829 if (output->wlr_output->current_mode != NULL && 827 if (output->wlr_output->current_mode != NULL &&
@@ -862,6 +860,10 @@ static void handle_commit(struct wl_listener *listener, void *data) {
862 struct sway_output *output = wl_container_of(listener, output, commit); 860 struct sway_output *output = wl_container_of(listener, output, commit);
863 struct wlr_output_event_commit *event = data; 861 struct wlr_output_event_commit *event = data;
864 862
863 if (event->committed & WLR_OUTPUT_STATE_MODE) {
864 handle_mode(output);
865 }
866
865 if (!output->enabled) { 867 if (!output->enabled) {
866 return; 868 return;
867 } 869 }
@@ -954,8 +956,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
954 output->destroy.notify = handle_destroy; 956 output->destroy.notify = handle_destroy;
955 wl_signal_add(&wlr_output->events.commit, &output->commit); 957 wl_signal_add(&wlr_output->events.commit, &output->commit);
956 output->commit.notify = handle_commit; 958 output->commit.notify = handle_commit;
957 wl_signal_add(&wlr_output->events.mode, &output->mode);
958 output->mode.notify = handle_mode;
959 wl_signal_add(&wlr_output->events.present, &output->present); 959 wl_signal_add(&wlr_output->events.present, &output->present);
960 output->present.notify = handle_present; 960 output->present.notify = handle_present;
961 wl_signal_add(&wlr_output->events.damage, &output->damage); 961 wl_signal_add(&wlr_output->events.damage, &output->damage);