From 177d761797b36fdadb246c0129cfb14bcc1c0c19 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 12 Nov 2020 23:22:39 +0100 Subject: Clipboard.c: fix: remove wrong optimization In the "none" case we must ensure the clipboard data is reset. This "optimization" skipped the reset part which made the code think it is waiting for an answer. Which (of course) never arrived. So any further request was rejected... Also reduce debugging output for the "none" case because resetClientSelectionStage will print it anyway. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f57459882..2856026f2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -480,26 +480,16 @@ static void resetClientSelectionStage(int index) static void setClientSelectionStage(int stage, int index) { - if (lastClients[index].stage == stage) - { - #ifdef DEBUG - fprintf(stderr, "%s: lastClient [%d] selection stage already set to [%s] - doing nothing\n", __func__, - index, getClientSelectionStageString(lastClients[index].stage)); - #endif - return; - } - - #ifdef DEBUG - fprintf(stderr, "%s: Changing selection stage for [%d] from [%s] to [%s]\n", __func__, index, - getClientSelectionStageString(lastClients[index].stage), getClientSelectionStageString(stage)); - #endif - if (stage == SelectionStageNone) { resetClientSelectionStage(index); } else { + #ifdef DEBUG + fprintf(stderr, "%s: Changing selection stage for [%d] from [%s] to [%s]\n", __func__, index, + getClientSelectionStageString(lastClients[index].stage), getClientSelectionStageString(stage)); + #endif lastClients[index].stage = stage; } } -- cgit v1.2.3