diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-06-19 21:14:12 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-10-15 18:34:09 +0100 |
commit | 50e9135c13c5a280aba3f1e6c891fc531439ebe9 (patch) | |
tree | 817648ca9ff0b92af3ba955bdc749b6461a076dd | |
parent | 334a7fa6a7bce3b08c2f5f14a18aa4f2f333fbb8 (diff) |
Improve clipboard startup in XDMCP mode Stop the "Clipboard not yet started, aborting" message from spamming the log.
from-xming-patch15
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rwxr-xr-x | hw/xwin/winclipboardwrappers.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c index 2cfe0ffce..fef22f749 100755 --- a/hw/xwin/winclipboardwrappers.c +++ b/hw/xwin/winclipboardwrappers.c @@ -40,6 +40,7 @@ * Constants */ +#define CLIP_NUM_CALLS 4 #define CLIP_NUM_SELECTIONS 2 #define CLIP_OWN_PRIMARY 0 #define CLIP_OWN_CLIPBOARD 1 @@ -85,6 +86,8 @@ winProcQueryTree (ClientPtr client) { int iReturn; + ErrorF ("winProcQueryTree - Hello\n"); + /* * This procedure is only used for initialization. * We can unwrap the original procedure at this point @@ -184,7 +187,7 @@ winProcEstablishConnection (ClientPtr client) static int s_iCallCount = 0; static unsigned long s_ulServerGeneration = 0; - ErrorF ("winProcEstablishConnection - Hello\n"); + if (s_iCallCount == 0 || s_iCallCount == CLIP_NUM_CALLS) ErrorF ("winProcEstablishConnection - Hello\n"); /* Do nothing if clipboard is not enabled */ if (!g_fClipboard) @@ -212,13 +215,15 @@ winProcEstablishConnection (ClientPtr client) /* Increment call count */ ++s_iCallCount; - /* Wait for second call when Xdmcp is enabled */ + /* Wait for CLIP_NUM_CALLS when Xdmcp is enabled */ if (g_fXdmcpEnabled && !g_fClipboardLaunched - && s_iCallCount < 4) + && s_iCallCount < CLIP_NUM_CALLS) { - ErrorF ("winProcEstablishConnection - Xdmcp enabled, waiting to " - "start clipboard client until fourth call.\n"); + if (s_iCallCount == 1) ErrorF ("winProcEstablishConnection - Xdmcp, waiting to " + "start clipboard client until %dth call", CLIP_NUM_CALLS); + if (s_iCallCount == CLIP_NUM_CALLS - 1) ErrorF (".\n"); + else ErrorF ("."); return (*winProcEstablishConnectionOrig) (client); } @@ -275,7 +280,7 @@ winProcEstablishConnection (ClientPtr client) * 8) Unfortunately, there is another problem. * 9) XDM walks the list of windows with XQueryTree, * killing any client it finds with a window. - * 10)Thus, when using XDMCP we wait until the second call + * 10)Thus, when using XDMCP we wait until CLIP_NUM_CALLS * to ProcEstablishCeonnection before we startup the clipboard * client. This should prevent XDM from finding the clipboard * client, since it has not yet created a window. @@ -335,8 +340,8 @@ winProcSetSelectionOwner (ClientPtr client) /* Abort if clipboard not completely initialized yet */ if (!g_fClipboardStarted) { - ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, " - "aborting.\n"); + /* ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, " + "aborting.\n"); */ goto winProcSetSelectionOwner_Done; } |