aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2019-01-17 22:30:24 +0100
committerLibravatar emersion <contact@emersion.fr>2019-01-18 10:09:10 +0100
commita737d7ecc4d7f4825ca7879e3449522bc87049be (patch)
tree7c40fbaebce93738d1f44d32f2d6f059a073e85e /sway/tree/output.c
parentoutput: remove output_add_listeners (diff)
downloadsway-a737d7ecc4d7f4825ca7879e3449522bc87049be.tar.gz
sway-a737d7ecc4d7f4825ca7879e3449522bc87049be.tar.zst
sway-a737d7ecc4d7f4825ca7879e3449522bc87049be.zip
Better handle outputs without CRTC
This happens if you plug in more outputs than supported by your GPU. This patch makes it so outputs without CRTCs appear as disabled. As soon as they get a CRTC (signalled via the mode event), we can enable them.
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 3c376c6b..21beb504 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -78,6 +78,12 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
78 } 78 }
79 79
80 output->enabled = true; 80 output->enabled = true;
81 if (!apply_output_config(oc, output)) {
82 output->enabled = false;
83 return;
84 }
85
86 output->configured = true;
81 list_add(root->outputs, output); 87 list_add(root->outputs, output);
82 88
83 output->lx = wlr_output->lx; 89 output->lx = wlr_output->lx;
@@ -104,8 +110,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
104 ipc_event_workspace(NULL, ws, "init"); 110 ipc_event_workspace(NULL, ws, "init");
105 } 111 }
106 112
107 apply_output_config(oc, output);
108
109 if (ws && config->default_orientation == L_NONE) { 113 if (ws && config->default_orientation == L_NONE) {
110 // Since the output transformation and resolution could have changed 114 // Since the output transformation and resolution could have changed
111 // due to applying the output config, the previously set layout for the 115 // due to applying the output config, the previously set layout for the