damage: untwist Xinerma handling

The diffenciation between Xinerama and single screen version is by tweaking
call vectors unncessarily complicated: it the only reason why these are
needed in the first place. Finally, it's just about one function, so it's
much easier just branching off in ProcDamageCreate() in case of Xinerama
is enabled.

This also clears the road for further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-07-09 10:30:33 +02:00
parent 659b1dfa00
commit 5e56e15191

View File

@ -42,7 +42,9 @@ typedef struct {
} PanoramiXDamageRes;
static RESTYPE XRT_DAMAGE;
static int (*PanoramiXSaveDamageCreate) (ClientPtr);
static int damageUseXinerama = 0;
static int PanoramiXDamageCreate(ClientPtr client);
#endif /* XINERAMA */
@ -303,6 +305,12 @@ ProcDamageCreate(ClientPtr client)
int rc;
REQUEST(xDamageCreateReq);
REQUEST_SIZE_MATCH(xDamageCreateReq);
#ifdef PANORAMIX
if (damageUseXinerama)
return PanoramiXDamageCreate(client);
#endif
LEGAL_NEW_RESOURCE(stuff->damage, client);
doDamageCreate(client, &rc);
return rc;
@ -704,14 +712,13 @@ PanoramiXDamageInit(void)
if (!XRT_DAMAGE)
FatalError("Couldn't Xineramify Damage extension\n");
PanoramiXSaveDamageCreate = ProcDamageVector[X_DamageCreate];
ProcDamageVector[X_DamageCreate] = PanoramiXDamageCreate;
damageUseXinerama = 1;
}
void
PanoramiXDamageReset(void)
{
ProcDamageVector[X_DamageCreate] = PanoramiXSaveDamageCreate;
damageUseXinerama = 0;
}
#endif /* XINERAMA */