RANDR 1.2: Only enable unknown outputs if there are no connected outputs.
Otherwise you end up with a confusing initial geometry, and xscreensaver and friends get very angry.
This commit is contained in:
parent
edebe76cfd
commit
23b8ca8a37
|
@ -463,7 +463,7 @@ xf86OutputSetMonitor (xf86OutputPtr output)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xf86OutputEnabled (xf86OutputPtr output)
|
xf86OutputEnabled (xf86OutputPtr output, Bool strict)
|
||||||
{
|
{
|
||||||
Bool enable, disable;
|
Bool enable, disable;
|
||||||
|
|
||||||
|
@ -481,8 +481,16 @@ xf86OutputEnabled (xf86OutputPtr output)
|
||||||
"Output %s disabled by config file\n", output->name);
|
"Output %s disabled by config file\n", output->name);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* otherwise, enable if it is not disconnected */
|
|
||||||
enable = output->status != XF86OutputStatusDisconnected;
|
/* If not, try to only light up the ones we know are connected */
|
||||||
|
if (strict) {
|
||||||
|
enable = output->status == XF86OutputStatusConnected;
|
||||||
|
}
|
||||||
|
/* But if that fails, try to light up even outputs we're unsure of */
|
||||||
|
else {
|
||||||
|
enable = output->status != XF86OutputStatusDisconnected;
|
||||||
|
}
|
||||||
|
|
||||||
xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
|
xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
|
||||||
"Output %s %sconnected\n", output->name, enable ? "" : "dis");
|
"Output %s %sconnected\n", output->name, enable ? "" : "dis");
|
||||||
return enable;
|
return enable;
|
||||||
|
@ -1571,7 +1579,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
|
||||||
Rotation target_rotation = RR_Rotate_0;
|
Rotation target_rotation = RR_Rotate_0;
|
||||||
xf86CrtcPtr *crtcs;
|
xf86CrtcPtr *crtcs;
|
||||||
DisplayModePtr *modes;
|
DisplayModePtr *modes;
|
||||||
Bool *enabled;
|
Bool *enabled, any_enabled = FALSE;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
|
@ -1604,9 +1612,23 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
|
||||||
xf86OutputPtr output = config->output[o];
|
xf86OutputPtr output = config->output[o];
|
||||||
|
|
||||||
modes[o] = NULL;
|
modes[o] = NULL;
|
||||||
enabled[o] = xf86OutputEnabled (output);
|
any_enabled |= (enabled[o] = xf86OutputEnabled (output, TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!any_enabled)
|
||||||
|
{
|
||||||
|
xf86DrvMsg (scrn->scrnIndex, X_WARNING,
|
||||||
|
"No outputs definitely connected, trying again...\n");
|
||||||
|
|
||||||
|
for (o = 0; o < config->num_output; o++)
|
||||||
|
{
|
||||||
|
xf86OutputPtr output = config->output[o];
|
||||||
|
|
||||||
|
modes[o] = NULL;
|
||||||
|
enabled[o] = xf86OutputEnabled (output, FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User preferred > preferred > other modes
|
* User preferred > preferred > other modes
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue