Commit c8cec758 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Clipboard.c: drop notifyConvertFailure

Moving the client check to sendSelectionNotifyEventToClient enables us to drop notifyConvertFailure.
parent ea0da6aa
...@@ -241,9 +241,6 @@ static void initSelectionOwner(int index, Atom selection); ...@@ -241,9 +241,6 @@ static void initSelectionOwner(int index, Atom selection);
static void clearSelectionOwner(int index); static void clearSelectionOwner(int index);
static void storeSelectionOwner(int index, Selection *sel); static void storeSelectionOwner(int index, Selection *sel);
static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow); static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow);
static void notifyConvertFailure(ClientPtr client, Window requestor,
Atom selection, Atom target, Time time);
static void setSelectionOwner(Selection *pSelection); static void setSelectionOwner(Selection *pSelection);
static int sendEventToClient(ClientPtr client, xEvent *pEvents); static int sendEventToClient(ClientPtr client, xEvent *pEvents);
static void sendSelectionNotifyEventToClient(ClientPtr client, static void sendSelectionNotifyEventToClient(ClientPtr client,
...@@ -493,6 +490,18 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, ...@@ -493,6 +490,18 @@ static void sendSelectionNotifyEventToClient(ClientPtr client,
Atom target, Atom target,
Atom property) Atom property)
{ {
/*
* Check if the client is still valid.
*/
if (clients[client -> index] != client)
{
#ifdef WARNING
fprintf(stderr, "%s: WARNING! Invalid client pointer.", __func__);
#endif
return;
}
xEvent x = {0}; xEvent x = {0};
x.u.u.type = SelectionNotify; x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time; x.u.selectionNotify.time = time;
...@@ -1714,24 +1723,6 @@ FIXME ...@@ -1714,24 +1723,6 @@ FIXME
*/ */
} }
static void notifyConvertFailure(ClientPtr client, Window requestor,
Atom selection, Atom target, Time time)
{
/*
* Check if the client is still valid.
*/
if (clients[client -> index] != client)
{
#ifdef WARNING
fprintf(stderr, "%s: WARNING! Invalid client pointer.", __func__);
#endif
return;
}
sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None);
}
/* /*
* This is called from dix (ProcConvertSelection) if an nxagent client * This is called from dix (ProcConvertSelection) if an nxagent client
* issues a ConvertSelection request. So all the Atoms are internal * issues a ConvertSelection request. So all the Atoms are internal
...@@ -1788,8 +1779,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1788,8 +1779,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
"notifying failure to client\n", __func__); "notifying failure to client\n", __func__);
#endif #endif
notifyConvertFailure(lastClientClientPtr, lastClientRequestor, sendSelectionNotifyEventToClient(lastClientClientPtr, lastClientTime, lastClientRequestor,
lastClientSelection, lastClientTarget, lastClientTime); lastClientSelection, lastClientTarget, None);
setClientSelectionStage(SelectionStageNone); setClientSelectionStage(SelectionStageNone);
} }
...@@ -1805,7 +1796,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1805,7 +1796,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
"before timeout expired on last request, notifying failure to client\n", __func__); "before timeout expired on last request, notifying failure to client\n", __func__);
#endif #endif
notifyConvertFailure(client, requestor, selection, target, time); sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None);
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment