aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winclipboardwndproc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-07 10:51:45 +0000
committermarha <marha@users.sourceforge.net>2011-03-07 10:51:45 +0000
commitfaed2dca735b7aa26a146c5e309cafa8134425b9 (patch)
tree497aab7a57588f4c697a764b97e6b12fbbc823ec /xorg-server/hw/xwin/winclipboardwndproc.c
parent4f15fcdc65f989800d91278a4040d14f9ebd76ca (diff)
downloadvcxsrv-faed2dca735b7aa26a146c5e309cafa8134425b9.tar.gz
vcxsrv-faed2dca735b7aa26a146c5e309cafa8134425b9.tar.bz2
vcxsrv-faed2dca735b7aa26a146c5e309cafa8134425b9.zip
Added clipboardprimary option to be able to only map THE CLIPBOARD selection to the windows clipboard. Default the CLIPBOARD and the PRIMARY selection are mapped.
Diffstat (limited to 'xorg-server/hw/xwin/winclipboardwndproc.c')
-rw-r--r--xorg-server/hw/xwin/winclipboardwndproc.c70
1 files changed, 37 insertions, 33 deletions
diff --git a/xorg-server/hw/xwin/winclipboardwndproc.c b/xorg-server/hw/xwin/winclipboardwndproc.c
index 1f2bf756a..540b2136a 100644
--- a/xorg-server/hw/xwin/winclipboardwndproc.c
+++ b/xorg-server/hw/xwin/winclipboardwndproc.c
@@ -326,21 +326,23 @@ winClipboardWindowProc (HWND hwnd, UINT message,
*/
XSync (pDisplay, FALSE);
- /* Release PRIMARY selection if owned */
- iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
- if (iReturn == g_iClipboardWindow)
- {
- winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "PRIMARY selection is owned by us.\n");
- XSetSelectionOwner (pDisplay,
- XA_PRIMARY,
- None,
- CurrentTime);
- }
- else if (BadWindow == iReturn || BadAtom == iReturn)
- ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "XGetSelection failed for PRIMARY: %d\n", iReturn);
-
+ if (g_fClipboardPrimary)
+ {
+ /* Release PRIMARY selection if owned */
+ iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
+ if (iReturn == g_iClipboardWindow)
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "PRIMARY selection is owned by us.\n");
+ XSetSelectionOwner (pDisplay,
+ XA_PRIMARY,
+ None,
+ CurrentTime);
+ }
+ else if (BadWindow == iReturn || BadAtom == iReturn)
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "XGetSelection failed for PRIMARY: %d\n", iReturn);
+ }
/* Release CLIPBOARD selection if owned */
iReturn = XGetSelectionOwner (pDisplay,
atomClipboard);
@@ -366,23 +368,25 @@ winClipboardWindowProc (HWND hwnd, UINT message,
/* Only reassert ownership when we did not change the clipboard ourselves */
if (hwnd!=(HWND)wParam)
{
- /* Reassert ownership of PRIMARY */
- iReturn = XSetSelectionOwner (pDisplay,
- XA_PRIMARY,
- iWindow,
- CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow ||
- XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
- {
- ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "Could not reassert ownership of PRIMARY\n");
- }
- else
- {
- winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "Reasserted ownership of PRIMARY\n");
- }
-
+ if (g_fClipboardPrimary)
+ {
+ /* Reassert ownership of PRIMARY */
+ iReturn = XSetSelectionOwner (pDisplay,
+ XA_PRIMARY,
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
+ {
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Could not reassert ownership of PRIMARY\n");
+ }
+ else
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Reasserted ownership of PRIMARY\n");
+ }
+ }
/* Reassert ownership of the CLIPBOARD */
iReturn = XSetSelectionOwner (pDisplay,
atomClipboard,
@@ -403,7 +407,7 @@ winClipboardWindowProc (HWND hwnd, UINT message,
/* Flush the pending SetSelectionOwner event now */
XFlush (pDisplay);
- }
+ }
s_fProcessingDrawClipboard = FALSE;
winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");