[PATCH 07/12] Xming: Select events correctly in clipboard integration code

Jon TURNEY jon.turney at dronecode.org.uk
Wed Feb 4 05:11:29 PST 2009


From: Colin Harrison <colin.harrison at virgin.net>

The clipboard should only select PropertyChange events and do this on
the correct window, the messaging window for the clipboard not the root
window!

Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 hw/xwin/winclipboardthread.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 19aa7ea..c1e8e13 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -233,15 +233,6 @@ winClipboardProc (void *pvNotUsed)
   iMaxDescriptor = iConnectionNumber + 1;
 #endif
 
-  /* Select event types to watch */
-  if (XSelectInput (pDisplay,
-		    DefaultRootWindow (pDisplay),
-		    SubstructureNotifyMask |
-		    StructureNotifyMask |
-		    PropertyChangeMask) == BadWindow)
-    ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
-	    "on RootWindow\n\n");
-
   /* Create atoms */
   atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
   atomClipboardManager = XInternAtom (pDisplay, "CLIPBOARD_MANAGER", False);
@@ -260,6 +251,13 @@ winClipboardProc (void *pvNotUsed)
       pthread_exit (NULL);
     }
 
+  /* Select event types to watch */
+  if (XSelectInput (pDisplay,
+		    iWindow,
+		    PropertyChangeMask) == BadWindow)
+    ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
+	    "on messaging window\n");
+
   /* Save the window in the screen privates */
   g_iClipboardWindow = iWindow;
 
-- 
1.6.0.4




More information about the xorg mailing list