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.
This commit is contained in:
emersion 2019-01-17 22:30:24 +01:00
parent dc1eac0cf1
commit a737d7ecc4
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
5 changed files with 47 additions and 15 deletions

View file

@ -78,6 +78,12 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
}
output->enabled = true;
if (!apply_output_config(oc, output)) {
output->enabled = false;
return;
}
output->configured = true;
list_add(root->outputs, output);
output->lx = wlr_output->lx;
@ -104,8 +110,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
ipc_event_workspace(NULL, ws, "init");
}
apply_output_config(oc, output);
if (ws && config->default_orientation == L_NONE) {
// Since the output transformation and resolution could have changed
// due to applying the output config, the previously set layout for the