aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-02-15 00:52:39 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-31 12:52:35 +0200
commitc8cec75860755be83c7f76b932bdbcadf6c2afbd (patch)
tree5c315dd3b2a5daed3a301c5e93c8cfa0dcdab5e6
parentea0da6aa1a9235b4aa0309409feed475c818fcaa (diff)
downloadnx-libs-c8cec75860755be83c7f76b932bdbcadf6c2afbd.tar.gz
nx-libs-c8cec75860755be83c7f76b932bdbcadf6c2afbd.tar.bz2
nx-libs-c8cec75860755be83c7f76b932bdbcadf6c2afbd.zip
Clipboard.c: drop notifyConvertFailure
Moving the client check to sendSelectionNotifyEventToClient enables us to drop notifyConvertFailure.
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 185a916d2..6291d4003 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -241,9 +241,6 @@ static void initSelectionOwner(int index, Atom selection);
static void clearSelectionOwner(int index);
static void storeSelectionOwner(int index, Selection *sel);
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 int sendEventToClient(ClientPtr client, xEvent *pEvents);
static void sendSelectionNotifyEventToClient(ClientPtr client,
@@ -493,6 +490,18 @@ static void sendSelectionNotifyEventToClient(ClientPtr client,
Atom target,
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};
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time;
@@ -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
* issues a ConvertSelection request. So all the Atoms are internal
@@ -1788,8 +1779,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
"notifying failure to client\n", __func__);
#endif
- notifyConvertFailure(lastClientClientPtr, lastClientRequestor,
- lastClientSelection, lastClientTarget, lastClientTime);
+ sendSelectionNotifyEventToClient(lastClientClientPtr, lastClientTime, lastClientRequestor,
+ lastClientSelection, lastClientTarget, None);
setClientSelectionStage(SelectionStageNone);
}
@@ -1805,7 +1796,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
"before timeout expired on last request, notifying failure to client\n", __func__);
#endif
- notifyConvertFailure(client, requestor, selection, target, time);
+ sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None);
return 1;
}