From a915739887477b28d924ecc8417ee107d125bd6c Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 6 Sep 2009 18:48:27 +0000 Subject: Switched to xorg-server-1.6.99.900.tar.gz --- xorg-server/hw/xwin/winclipboardwrappers.c | 43 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'xorg-server/hw/xwin/winclipboardwrappers.c') diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c index 2cfe0ffce..c68d78aa3 100644 --- a/xorg-server/hw/xwin/winclipboardwrappers.c +++ b/xorg-server/hw/xwin/winclipboardwrappers.c @@ -1,5 +1,6 @@ /* *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. + *Copyright (C) Colin Harrison 2005-2008 * *Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -20,12 +21,13 @@ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. + *Except as contained in this notice, the name of the copyright holder(s) + *and author(s) shall not be used in advertising or otherwise to promote + *the sale, use or other dealings in this Software without prior written + *authorization from the copyright holder(s) and author(s). * * Authors: Harold L Hunt II + * Colin Harrison */ #ifdef HAVE_XWIN_CONFIG_H @@ -40,6 +42,7 @@ * Constants */ +#define CLIP_NUM_CALLS 4 #define CLIP_NUM_SELECTIONS 2 #define CLIP_OWN_PRIMARY 0 #define CLIP_OWN_CLIPBOARD 1 @@ -85,6 +88,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 +189,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 +217,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 +282,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 +342,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; } @@ -430,11 +437,9 @@ winProcSetSelectionOwner (ClientPtr client) * an owned to not owned transition was detected, * and we currently own the Win32 clipboard. */ - if (None == stuff->window - && (None == s_iOwners[CLIP_OWN_PRIMARY] - || g_iClipboardWindow == s_iOwners[CLIP_OWN_PRIMARY]) - && (None == s_iOwners[CLIP_OWN_CLIPBOARD] - || g_iClipboardWindow == s_iOwners[CLIP_OWN_CLIPBOARD]) + if (stuff->window == None + && s_iOwners[CLIP_OWN_PRIMARY] == None + && s_iOwners[CLIP_OWN_CLIPBOARD] == None && fOwnedToNotOwned && g_hwndClipboard != NULL && g_hwndClipboard == GetClipboardOwner ()) @@ -451,10 +456,6 @@ winProcSetSelectionOwner (ClientPtr client) EmptyClipboard (); CloseClipboard (); - /* Clear X selection ownership (might still be marked as us owning) */ - s_iOwners[CLIP_OWN_PRIMARY] = None; - s_iOwners[CLIP_OWN_CLIPBOARD] = None; - goto winProcSetSelectionOwner_Done; } -- cgit v1.2.3