mirror of
https://github.com/swaywm/sway.git
synced 2026-04-24 06:46:22 -04:00
output: reapply output config when fixed modes change
Listen to the signal `available_modes` which indicates that an output has changed its set of available fixed modes, and reapply the output config.
This commit is contained in:
parent
661cdac2d6
commit
3eb9cf4a45
2 changed files with 14 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ struct sway_output {
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
struct wl_listener mode;
|
struct wl_listener mode;
|
||||||
|
struct wl_listener available_modes;
|
||||||
struct wl_listener present;
|
struct wl_listener present;
|
||||||
struct wl_listener damage_destroy;
|
struct wl_listener damage_destroy;
|
||||||
struct wl_listener damage_frame;
|
struct wl_listener damage_frame;
|
||||||
|
|
|
||||||
|
|
@ -872,6 +872,17 @@ static void handle_mode(struct wl_listener *listener, void *data) {
|
||||||
update_output_manager_config(output->server);
|
update_output_manager_config(output->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_available_modes(struct wl_listener *listener, void *data) {
|
||||||
|
struct sway_output *output = wl_container_of(listener, output, available_modes);
|
||||||
|
struct output_config *oc = find_output_config(output);
|
||||||
|
apply_output_config(oc, output);
|
||||||
|
free_output_config(oc);
|
||||||
|
|
||||||
|
transaction_commit_dirty();
|
||||||
|
|
||||||
|
update_output_manager_config(output->server);
|
||||||
|
}
|
||||||
|
|
||||||
static void update_textures(struct sway_container *con, void *data) {
|
static void update_textures(struct sway_container *con, void *data) {
|
||||||
container_update_title_textures(con);
|
container_update_title_textures(con);
|
||||||
container_update_marks_textures(con);
|
container_update_marks_textures(con);
|
||||||
|
|
@ -928,6 +939,8 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
||||||
output->commit.notify = handle_commit;
|
output->commit.notify = handle_commit;
|
||||||
wl_signal_add(&wlr_output->events.mode, &output->mode);
|
wl_signal_add(&wlr_output->events.mode, &output->mode);
|
||||||
output->mode.notify = handle_mode;
|
output->mode.notify = handle_mode;
|
||||||
|
wl_signal_add(&wlr_output->events.available_modes, &output->available_modes);
|
||||||
|
output->available_modes.notify = handle_available_modes;
|
||||||
wl_signal_add(&wlr_output->events.present, &output->present);
|
wl_signal_add(&wlr_output->events.present, &output->present);
|
||||||
output->present.notify = handle_present;
|
output->present.notify = handle_present;
|
||||||
wl_signal_add(&output->damage->events.frame, &output->damage_frame);
|
wl_signal_add(&output->damage->events.frame, &output->damage_frame);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue