aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-01-20 09:01:33 -0500
committerGitHub <noreply@github.com>2019-01-20 09:01:33 -0500
commita3d350407246c8ea2066c2126c4a86275b59d214 (patch)
tree91e76336687d53e2e352a22ef507e6586f1ce930 /sway
parent62260ab56e398aba81fef1a3b6d5f72d6aa6532d (diff)
parent0bf3252d8b427964788219dc176cec6509f96326 (diff)
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.c12
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) {
static void handle_mode(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, mode);
- if (!output->configured) {
- return;
- }
- if (!output->enabled) {
+ if (!output->configured && !output->enabled) {
struct output_config *oc = output_find_config(output);
if (output->wlr_output->current_mode != NULL &&
(!oc || oc->enabled)) {
// We want to enable this output, but it didn't work last time,
// possibly because we hadn't enough CRTCs. Try again now that the
// output has a mode.
- output_enable(output, oc);
+ wlr_log(WLR_DEBUG, "Output %s has gained a CRTC, "
+ "trying to enable it", output->wlr_output->name);
+ apply_output_config(oc, output);
}
return;
}
+ if (!output->enabled || !output->configured) {
+ return;
+ }
arrange_layers(output);
arrange_output(output);
transaction_commit_dirty();