mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 10:14:52 +00:00
xfree86: dga: simplify DGAClientStateChange()
Simply do the action on matched screen inside the loop instead of saving the found client and acting on it later (if found). Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
93d1a2681f
commit
e3122e411c
@@ -1306,29 +1306,26 @@ static void
|
||||
DGAClientStateChange(CallbackListPtr *pcbl, void *nulldata, void *calldata)
|
||||
{
|
||||
NewClientInfoRec *pci = (NewClientInfoRec *) calldata;
|
||||
ClientPtr client = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
if (DGA_GETCLIENT(i) == pci->client) {
|
||||
client = pci->client;
|
||||
if (pci->client && (DGA_GETCLIENT(i) == pci->client)) {
|
||||
if ((pci->client->clientState == ClientStateGone) ||
|
||||
(pci->client->clientState == ClientStateRetained))
|
||||
{
|
||||
XDGAModeRec mode;
|
||||
PixmapPtr pPix;
|
||||
|
||||
DGA_SETCLIENT(i, NULL);
|
||||
DGASelectInput(i, NULL, 0);
|
||||
DGASetMode(i, 0, &mode, &pPix);
|
||||
|
||||
if (--DGACallbackRefCount == 0)
|
||||
DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (client &&
|
||||
((client->clientState == ClientStateGone) ||
|
||||
(client->clientState == ClientStateRetained))) {
|
||||
XDGAModeRec mode;
|
||||
PixmapPtr pPix;
|
||||
|
||||
DGA_SETCLIENT(i, NULL);
|
||||
DGASelectInput(i, NULL, 0);
|
||||
DGASetMode(i, 0, &mode, &pPix);
|
||||
|
||||
if (--DGACallbackRefCount == 0)
|
||||
DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user