aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winclipboardwrappers.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-02 08:25:18 +0000
committermarha <marha@users.sourceforge.net>2010-11-02 08:25:18 +0000
commite917c45e1fe37347084167de1b92dd10ee63bebf (patch)
tree44a2627d35457a051e7414357c1f805603115b2f /xorg-server/hw/xwin/winclipboardwrappers.c
parent21bb0e6badd67f4118d8e8a21aa7691dbde41c76 (diff)
downloadvcxsrv-e917c45e1fe37347084167de1b92dd10ee63bebf.tar.gz
vcxsrv-e917c45e1fe37347084167de1b92dd10ee63bebf.tar.bz2
vcxsrv-e917c45e1fe37347084167de1b92dd10ee63bebf.zip
Remove no-longer needed tricks used to hide the clipboard client from XDM to prevent
it from being killed
Diffstat (limited to 'xorg-server/hw/xwin/winclipboardwrappers.c')
-rw-r--r--xorg-server/hw/xwin/winclipboardwrappers.c124
1 files changed, 1 insertions, 123 deletions
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c
index 3155b8c1f..e7325178d 100644
--- a/xorg-server/hw/xwin/winclipboardwrappers.c
+++ b/xorg-server/hw/xwin/winclipboardwrappers.c
@@ -42,7 +42,6 @@
* Constants
*/
-#define CLIP_NUM_CALLS 4
#define CLIP_NUM_SELECTIONS 2
#define CLIP_OWN_PRIMARY 0
#define CLIP_OWN_CLIPBOARD 1
@@ -53,7 +52,6 @@
*/
int winProcEstablishConnection(ClientPtr /* client */);
-int winProcQueryTree(ClientPtr /* client */);
int winProcSetSelectionOwner(ClientPtr /* client */);
@@ -74,109 +72,10 @@ extern Atom g_atomLastOwnedSelection;
extern HWND g_hwndClipboard;
extern winDispatchProcPtr winProcEstablishConnectionOrig;
-extern winDispatchProcPtr winProcQueryTreeOrig;
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
/*
- * Wrapper for internal QueryTree function.
- * Hides the clipboard client when it is the only client remaining.
- */
-
-int
-winProcQueryTree (ClientPtr client)
-{
- int iReturn;
-
- winDebug ("winProcQueryTree - Hello\n");
-
- /*
- * This procedure is only used for initialization.
- * We can unwrap the original procedure at this point
- * so that this function is no longer called until the
- * server resets and the function is wrapped again.
- */
- ProcVector[X_QueryTree] = winProcQueryTreeOrig;
-
- /*
- * Call original function and bail if it fails.
- * NOTE: We must do this first, since we need XdmcpOpenDisplay
- * to be called before we initialize our clipboard client.
- */
- iReturn = (*winProcQueryTreeOrig) (client);
- if (iReturn != 0)
- {
- ErrorF ("winProcQueryTree - ProcQueryTree failed, bailing.\n");
- return iReturn;
- }
-
- /* Make errors more obvious */
- winProcQueryTreeOrig = NULL;
-
- /* Do nothing if clipboard is not enabled */
- if (!g_fClipboard)
- {
- winDebug ("winProcQueryTree - Clipboard is not enabled, "
- "returning.\n");
- return iReturn;
- }
-
- /* If the clipboard client has already been started, abort */
- if (g_fClipboardLaunched)
- {
- winDebug ("winProcQueryTree - Clipboard client already "
- "launched, returning.\n");
- return iReturn;
- }
-
- /* Startup the clipboard client if clipboard mode is being used */
- if (g_fXdmcpEnabled && g_fClipboard)
- {
- /*
- * NOTE: The clipboard client is started here for a reason:
- * 1) Assume you are using XDMCP (e.g. XWin -query %hostname%)
- * 2) If the clipboard client attaches during X Server startup,
- * then it becomes the "magic client" that causes the X Server
- * to reset if it exits.
- * 3) XDMCP calls KillAllClients when it starts up.
- * 4) The clipboard client is a client, so it is killed.
- * 5) The clipboard client is the "magic client", so the X Server
- * resets itself.
- * 6) This repeats ad infinitum.
- * 7) We avoid this by waiting until at least one client (could
- * be XDM, could be another client) connects, which makes it
- * almost certain that the clipboard client will not connect
- * until after XDM when using XDMCP.
- * 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 first call
- * to ProcQueryTree before we startup the clipboard client.
- * This should prevent XDM from finding the clipboard client,
- * since it has not yet created a window.
- * 11)Startup when not using XDMCP is handled in
- * winProcEstablishConnection.
- */
-
- /* Create the clipboard client thread */
- if (!winInitClipboard ())
- {
- ErrorF ("winProcQueryTree - winClipboardInit "
- "failed.\n");
- return iReturn;
- }
-
- winDebug ("winProcQueryTree - winInitClipboard returned.\n");
- }
-
- /* Flag that clipboard client has been launched */
- g_fClipboardLaunched = TRUE;
-
- return iReturn;
-}
-
-
-/*
* Wrapper for internal EstablishConnection function.
* Initializes internal clients that must not be started until
* an external client has connected.
@@ -190,7 +89,7 @@ winProcEstablishConnection (ClientPtr client)
static unsigned long s_ulServerGeneration = 0;
#ifdef WINDBG
- if (s_iCallCount == 0 || s_iCallCount == CLIP_NUM_CALLS) winDebug ("winProcEstablishConnection - Hello\n");
+ if (s_iCallCount == 0) winDebug ("winProcEstablishConnection - Hello\n");
#endif
/* Do nothing if clipboard is not enabled */
@@ -219,20 +118,6 @@ winProcEstablishConnection (ClientPtr client)
/* Increment call count */
++s_iCallCount;
- /* Wait for CLIP_NUM_CALLS when Xdmcp is enabled */
- if (g_fXdmcpEnabled
- && !g_fClipboardLaunched
- && s_iCallCount < CLIP_NUM_CALLS)
- {
- #ifdef WINDBG
- if (s_iCallCount == 1) winDebug ("winProcEstablishConnection - Xdmcp, waiting to "
- "start clipboard client until %dth call", CLIP_NUM_CALLS);
- if (s_iCallCount == CLIP_NUM_CALLS - 1) winDebug (".\n");
- else winDebug (".");
- #endif
- return (*winProcEstablishConnectionOrig) (client);
- }
-
/*
* This procedure is only used for initialization.
* We can unwrap the original procedure at this point
@@ -283,13 +168,6 @@ winProcEstablishConnection (ClientPtr client)
* be XDM, could be another client) connects, which makes it
* almost certain that the clipboard client will not connect
* until after XDM when using XDMCP.
- * 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 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.
*/
/* Create the clipboard client thread */