diff options
author | 2019-01-20 09:01:33 -0500 | |
---|---|---|
committer | 2019-01-20 09:01:33 -0500 | |
commit | a3d350407246c8ea2066c2126c4a86275b59d214 (patch) | |
tree | 91e76336687d53e2e352a22ef507e6586f1ce930 /sway | |
parent | Fix backup methods in get_socketpath for IPC client (diff) | |
parent | Fix re-enabling outputs gaining a CRTC (diff) | |
download | sway-a3d350407246c8ea2066c2126c4a86275b59d214.tar.gz sway-a3d350407246c8ea2066c2126c4a86275b59d214.tar.zst sway-a3d350407246c8ea2066c2126c4a86275b59d214.zip |
Merge pull request #3468 from emersion/fix-output-gain-crtc
Fix re-enabling outputs gaining a CRTC
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index ef242a4c..646b6d70 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -503,20 +503,22 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
503 | 503 | ||
504 | static void handle_mode(struct wl_listener *listener, void *data) { | 504 | static void handle_mode(struct wl_listener *listener, void *data) { |
505 | struct sway_output *output = wl_container_of(listener, output, mode); | 505 | struct sway_output *output = wl_container_of(listener, output, mode); |
506 | if (!output->configured) { | 506 | if (!output->configured && !output->enabled) { |
507 | return; | ||
508 | } | ||
509 | if (!output->enabled) { | ||
510 | struct output_config *oc = output_find_config(output); | 507 | struct output_config *oc = output_find_config(output); |
511 | if (output->wlr_output->current_mode != NULL && | 508 | if (output->wlr_output->current_mode != NULL && |
512 | (!oc || oc->enabled)) { | 509 | (!oc || oc->enabled)) { |
513 | // We want to enable this output, but it didn't work last time, | 510 | // We want to enable this output, but it didn't work last time, |
514 | // possibly because we hadn't enough CRTCs. Try again now that the | 511 | // possibly because we hadn't enough CRTCs. Try again now that the |
515 | // output has a mode. | 512 | // output has a mode. |
516 | output_enable(output, oc); | 513 | wlr_log(WLR_DEBUG, "Output %s has gained a CRTC, " |
514 | "trying to enable it", output->wlr_output->name); | ||
515 | apply_output_config(oc, output); | ||
517 | } | 516 | } |
518 | return; | 517 | return; |
519 | } | 518 | } |
519 | if (!output->enabled || !output->configured) { | ||
520 | return; | ||
521 | } | ||
520 | arrange_layers(output); | 522 | arrange_layers(output); |
521 | arrange_output(output); | 523 | arrange_output(output); |
522 | transaction_commit_dirty(); | 524 | transaction_commit_dirty(); |