aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 60792bb44..fe6d39281 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -1863,6 +1863,24 @@ FIXME
int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
Window requestor, Atom property, Atom target, Time time)
{
+ const char *strTarget = NameForAtom(target);
+
+ #ifdef DEBUG
+ fprintf(stderr, "%s: client %s requests sel [%s] "
+ "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__,
+ nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor,
+ property, validateString(NameForAtom(property)),
+ target, validateString(strTarget));
+ #endif
+
+ if (strTarget == NULL)
+ {
+ #ifdef DEBUG
+ fprintf(stderr, "%s: cannot find name for target Atom [%d] - returning\n", __func__, target);
+ #endif
+ return 1;
+ }
+
if (!agentClipboardInitialized)
{
#ifdef DEBUG
@@ -1915,20 +1933,22 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT)
{
#ifdef DEBUG
- fprintf(stderr, "%s: timeout expired on last request, "
+ fprintf(stderr, "%s: timeout expired on previous request, "
"notifying failure to client %s\n", __func__, nxagentClientInfoString(client));
#endif
/* notify the waiting client of failure */
endTransfer(SELECTION_FAULT, index);
- return 1;
+
+ /* do NOT return here but process the new request instead! */
}
else
{
/*
* we got another convert request while already waiting for an
- * answer from the real X server to a previous convert request,
- * which we cannot handle (yet). So return an error.
+ * answer from the real X server to a previous convert request
+ * for this selection, which we cannot handle (yet). So return
+ * an error for the new request.
*/
#ifdef DEBUG
fprintf(stderr, "%s: got new request "
@@ -1943,24 +1963,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
}
}
- const char *strTarget = NameForAtom(target);
-
- #ifdef DEBUG
- fprintf(stderr, "%s: client %s requests sel [%s] "
- "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__,
- nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor,
- property, validateString(NameForAtom(property)),
- target, validateString(strTarget));
- #endif
-
- if (strTarget == NULL)
- {
- #ifdef DEBUG
- fprintf(stderr, "%s: cannot find name for target Atom [%d] - returning\n", __func__, target);
- #endif
- return 1;
- }
-
/*
* The selection request target is TARGETS. The requestor is asking
* for a list of supported data formats.