diff options
-rw-r--r-- | include/sway/output.h | 2 | ||||
-rw-r--r-- | sway/config/output.c | 1 | ||||
-rw-r--r-- | sway/desktop/output.c | 1 | ||||
-rw-r--r-- | sway/tree/output.c | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index c52b3094..7d7057e1 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -32,6 +32,8 @@ struct sway_output { | |||
32 | int lx, ly; // layout coords | 32 | int lx, ly; // layout coords |
33 | int width, height; // transformed buffer size | 33 | int width, height; // transformed buffer size |
34 | enum wl_output_subpixel detected_subpixel; | 34 | enum wl_output_subpixel detected_subpixel; |
35 | // last applied mode when the output is DPMS'ed | ||
36 | struct wlr_output_mode *current_mode; | ||
35 | 37 | ||
36 | bool enabled, configured; | 38 | bool enabled, configured; |
37 | list_t *workspaces; | 39 | list_t *workspaces; |
diff --git a/sway/config/output.c b/sway/config/output.c index 3c36692f..50bf1155 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -278,6 +278,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
278 | sway_log(SWAY_ERROR, "Failed to modeset output %s", wlr_output->name); | 278 | sway_log(SWAY_ERROR, "Failed to modeset output %s", wlr_output->name); |
279 | return false; | 279 | return false; |
280 | } | 280 | } |
281 | output->current_mode = wlr_output->current_mode; | ||
281 | 282 | ||
282 | if (oc && oc->scale > 0) { | 283 | if (oc && oc->scale > 0) { |
283 | sway_log(SWAY_DEBUG, "Set %s scale to %f", oc->name, oc->scale); | 284 | sway_log(SWAY_DEBUG, "Set %s scale to %f", oc->name, oc->scale); |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 42194d54..beb6ee79 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -662,6 +662,7 @@ static void update_output_manager_config(struct sway_server *server) { | |||
662 | root->output_layout, output->wlr_output); | 662 | root->output_layout, output->wlr_output); |
663 | // We mark the output enabled even if it is switched off by DPMS | 663 | // We mark the output enabled even if it is switched off by DPMS |
664 | config_head->state.enabled = output->enabled; | 664 | config_head->state.enabled = output->enabled; |
665 | config_head->state.mode = output->current_mode; | ||
665 | if (output_box) { | 666 | if (output_box) { |
666 | config_head->state.x = output_box->x; | 667 | config_head->state.x = output_box->x; |
667 | config_head->state.y = output_box->y; | 668 | config_head->state.y = output_box->y; |
diff --git a/sway/tree/output.c b/sway/tree/output.c index 33fdee5e..07f04ee5 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -269,6 +269,7 @@ void output_disable(struct sway_output *output) { | |||
269 | 269 | ||
270 | output->enabled = false; | 270 | output->enabled = false; |
271 | output->configured = false; | 271 | output->configured = false; |
272 | output->current_mode = NULL; | ||
272 | 273 | ||
273 | arrange_root(); | 274 | arrange_root(); |
274 | } | 275 | } |