Compare commits

...

1 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 3948dbd72e xfixes: consolidate ProcXFixesSelectSelectionInput()
No need to have it ripped into two pieces, just making upcoming
changes more complicated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-15 19:07:00 +02:00

View File

@ -116,26 +116,36 @@ CheckSelectionCallback(void)
XFixesSelectionWindowDestroyNotifyMask |\
XFixesSelectionClientCloseNotifyMask)
static int
XFixesSelectSelectionInput(ClientPtr pClient,
Atom selection_name, WindowPtr pWindow, CARD32 eventMask)
int
ProcXFixesSelectSelectionInput(ClientPtr client)
{
REQUEST(xXFixesSelectSelectionInputReq);
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
WindowPtr pWindow;
int rc = dixLookupWindow(&pWindow, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if (stuff->eventMask & ~SelectionAllEvents) {
client->errorValue = stuff->eventMask;
return BadValue;
}
void *val;
int rc;
SelectionEventPtr *prev, e;
Selection *selection;
rc = dixLookupSelection(&selection, selection_name, pClient, DixGetAttrAccess);
rc = dixLookupSelection(&selection, stuff->selection, client, DixGetAttrAccess);
if (rc != Success)
return rc;
for (prev = &selectionEvents; (e = *prev); prev = &e->next) {
if (e->selection == selection &&
e->pClient == pClient && e->pWindow == pWindow) {
e->pClient == client && e->pWindow == pWindow) {
break;
}
}
if (!eventMask) {
if (!stuff->eventMask) {
if (e) {
FreeResource(e->clientResource, 0);
}
@ -148,9 +158,9 @@ XFixesSelectSelectionInput(ClientPtr pClient,
e->next = 0;
e->selection = selection;
e->pClient = pClient;
e->pClient = client;
e->pWindow = pWindow;
e->clientResource = FakeClientID(pClient->index);
e->clientResource = FakeClientID(client->index);
/*
* Add a resource hanging from the window to
@ -175,29 +185,10 @@ XFixesSelectSelectionInput(ClientPtr pClient,
return BadAlloc;
}
}
e->eventMask = eventMask;
e->eventMask = stuff->eventMask;
return Success;
}
int
ProcXFixesSelectSelectionInput(ClientPtr client)
{
REQUEST(xXFixesSelectSelectionInputReq);
WindowPtr pWin;
int rc;
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if (stuff->eventMask & ~SelectionAllEvents) {
client->errorValue = stuff->eventMask;
return BadValue;
}
return XFixesSelectSelectionInput(client, stuff->selection,
pWin, stuff->eventMask);
}
int _X_COLD
SProcXFixesSelectSelectionInput(ClientPtr client)
{