From 7cb1622ce44754d9dcd6f405fb8403bd79c3e7e4 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Tue, 3 Feb 2009 15:51:02 +0000 Subject: [PATCH] Xming: Select events correctly in clipboard integration code 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 --- hw/xwin/winclipboardthread.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index 19aa7ea24..c1e8e131c 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;