aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winclipboardwrappers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winclipboardwrappers.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/winclipboardwrappers.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c
index 2e6b63287..cf0d5f951 100644..100755
--- a/xorg-server/hw/xwin/winclipboardwrappers.c
+++ b/xorg-server/hw/xwin/winclipboardwrappers.c
@@ -36,12 +36,28 @@
#include "win.h"
#include "dixstruct.h"
+#include <X11/Xatom.h>
+
+/*
+ * Constants
+ */
+
+#define CLIP_NUM_SELECTIONS 2
+#define CLIP_OWN_PRIMARY 0
+#define CLIP_OWN_CLIPBOARD 1
/*
* Local function prototypes
*/
DISPATCH_PROC(winProcEstablishConnection);
+DISPATCH_PROC(winProcSetSelectionOwner);
+
+extern Bool g_fClipboardLaunched;
+extern Bool g_fClipboardStarted;
+extern Window g_iClipboardWindow;
+extern Atom g_atomLastOwnedSelection;
+extern HWND g_hwndClipboard;
/*
* Wrapper for internal EstablishConnection function.
@@ -56,12 +72,14 @@ winProcEstablishConnection(ClientPtr client)
static int s_iCallCount = 0;
static unsigned long s_ulServerGeneration = 0;
+ #ifdef WINDBG
if (s_iCallCount == 0)
winDebug("winProcEstablishConnection - Hello\n");
+ #endif
/* Do nothing if clipboard is not enabled */
if (!g_fClipboard) {
- ErrorF("winProcEstablishConnection - Clipboard is not enabled, "
+ winDebug ("winProcEstablishConnection - Clipboard is not enabled, "
"returning.\n");
/* Unwrap the original function, call it, and return */
@@ -106,6 +124,13 @@ winProcEstablishConnection(ClientPtr client)
/* Clear original function pointer */
winProcEstablishConnectionOrig = NULL;
+ /* If the clipboard client has already been started, abort */
+ if (g_fClipboardLaunched) {
+ winDebug ("winProcEstablishConnection - Clipboard client already "
+ "launched, returning.\n");
+ return iReturn;
+ }
+
/* Startup the clipboard client if clipboard mode is being used */
if (g_fClipboard) {
/*
@@ -132,8 +157,11 @@ winProcEstablishConnection(ClientPtr client)
return iReturn;
}
- ErrorF("winProcEstablishConnection - winInitClipboard returned.\n");
+ winDebug ("winProcEstablishConnection - winInitClipboard returned.\n");
}
+ /* Flag that clipboard client has been launched */
+ g_fClipboardLaunched = TRUE;
+
return iReturn;
}