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 <jon.turney@dronecode.org.uk>
This commit is contained in:
Colin Harrison 2009-02-03 15:51:02 +00:00 committed by Jon TURNEY
parent b997b3849d
commit 7cb1622ce4

View File

@ -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;