Merge branch 'master' into 'master'

randr: clear primary screen's primaryOutput when the output is deleted

See merge request xorg/xserver!1553
This commit is contained in:
hongaoo 2026-01-22 21:57:52 +00:00
commit c9fc81a8af

View file

@ -377,6 +377,8 @@ RROutputDestroyResource(void *value, XID pid)
{
RROutputPtr output = (RROutputPtr) value;
ScreenPtr pScreen = output->pScreen;
ScreenPtr primary;
rrScrPrivPtr primarysp;
int m;
if (pScreen) {
@ -397,6 +399,15 @@ RROutputDestroyResource(void *value, XID pid)
if (pScrPriv->primaryOutput == output)
pScrPriv->primaryOutput = NULL;
if (pScreen->isGPU) {
primary = pScreen->current_primary;
if (primary) {
primarysp = rrGetScrPriv(primary);
if(primarysp->primaryOutput == output)
primarysp->primaryOutput = NULL;
}
}
for (i = 0; i < pScrPriv->numOutputs; i++) {
if (pScrPriv->outputs[i] == output) {
memmove(pScrPriv->outputs + i, pScrPriv->outputs + i + 1,