From 25cbfd14f01bf2cdeb7504a5d8a3b03d924e243f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 4 Aug 2019 00:51:06 +0200 Subject: Clipboard.c: merge endTransfer and nxagentSendSelectionNotify endTransfer is the only caller --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 37 +++++++++----------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Clipboard.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 9064598a6..f5b163720 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -201,7 +201,6 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; extern Display *nxagentDisplay; Bool nxagentValidServerTargets(Atom target); -void nxagentSendSelectionNotify(Atom property); static void endTransfer(Bool success); #define SELECTION_SUCCESS True #define SELECTION_FAULT False @@ -737,24 +736,6 @@ FIXME: Do we need this? nxagentPrintClipboardStat("after nxagentRequestSelection"); } -void nxagentSendSelectionNotify(Atom property) -{ - if (lastClientClientPtr == NULL) - { - #ifdef DEBUG - fprintf(stderr, "%s: lastClientClientPtr is NULL - doing nothing.\n", __func__); - #endif - return; - } - - SendSelectionNotifyEventToClient(lastClientClientPtr, - lastClientTime, - lastClientRequestor, - lastClientSelection, - lastClientTarget, - property); -} - /* * client and resetting the corresponding variables and the state * machine. If success is False send a None reply, meaning "request @@ -763,15 +744,21 @@ void nxagentSendSelectionNotify(Atom property) */ static void endTransfer(Bool success) { - if (success == SELECTION_SUCCESS) - { - nxagentSendSelectionNotify(lastClientProperty); - } - else + if (lastClientClientPtr == NULL) { - nxagentSendSelectionNotify(None); + #ifdef DEBUG + fprintf(stderr, "%s: lastClientClientPtr is NULL - doing nothing.\n", __func__); + #endif + return; } + SendSelectionNotifyEventToClient(lastClientClientPtr, + lastClientTime, + lastClientRequestor, + lastClientSelection, + lastClientTarget, + success == SELECTION_SUCCESS ? lastClientProperty : None); + /* * Enable further requests from clients. */ -- cgit v1.2.3