aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winclipboard/thread.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
committermarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
commit5e5a48ff8cd08f123601cd0625ca62a86675aac9 (patch)
treeea1c2cee139e8e1ce389a7f956e9874db1e0a650 /xorg-server/hw/xwin/winclipboard/thread.c
parenta1011d63ffb5cc4f41bf0f4622ee3f1493d419d9 (diff)
downloadvcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.gz
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.bz2
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.zip
fontconfig libX11 mesa xserver git update 4 Jan 2015
xserver commit dc777c346d5d452a53b13b917c45f6a1bad2f20b libX11 commit 446f5f7f41317a85a0cd0efa5e6a1b37bc99fba2 fontconfig commit 4420b27c074821a1d1f9d6ebe822a610176a417d mesa commit 48094d0e6554a9df36bf00fc2793ade46cf92406
Diffstat (limited to 'xorg-server/hw/xwin/winclipboard/thread.c')
-rw-r--r--xorg-server/hw/xwin/winclipboard/thread.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/xorg-server/hw/xwin/winclipboard/thread.c b/xorg-server/hw/xwin/winclipboard/thread.c
index c179e3f83..50e1e8cb5 100644
--- a/xorg-server/hw/xwin/winclipboard/thread.c
+++ b/xorg-server/hw/xwin/winclipboard/thread.c
@@ -123,6 +123,7 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
int iSelectError;
Bool fShutdown = FALSE;
static Bool fErrorHandlerSet = FALSE;
+ ClipboardConversionData data;
winDebug("winClipboardProc - Hello\n");
@@ -254,21 +255,25 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
}
}
- /* Pre-flush X events */
- /*
- * NOTE: Apparently you'll freeze if you don't do this,
- * because there may be events in local data structures
- * already.
- */
- winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode, &atoms);
-
- /* Pre-flush Windows messages */
- if (!winClipboardFlushWindowsMessageQueue(hwnd)) {
- ErrorF("winClipboardProc - winClipboardFlushWindowsMessageQueue failed\n");
- }
+ data.fUseUnicode = fUseUnicode;
- /* Loop for X events */
+ /* Loop for events */
while (1) {
+
+ /* Process X events */
+ winClipboardFlushXEvents(hwnd,
+ iWindow, pDisplay, &data, &atoms);
+
+ /* Process Windows messages */
+ if (!winClipboardFlushWindowsMessageQueue(hwnd)) {
+ ErrorF("winClipboardProc - winClipboardFlushWindowsMessageQueue trapped "
+ "WM_QUIT message, exiting main loop.\n");
+ break;
+ }
+
+ /* We need to ensure that all pending requests are sent */
+ XFlush(pDisplay);
+
/* Setup the file descriptor set */
/*
* NOTE: You have to do this before every call to select
@@ -315,10 +320,9 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
break;
}
- /* Branch on which descriptor became active */
if (FD_ISSET(iConnectionNumber, &fdsRead)) {
- /* Process X events */
- winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode, &atoms);
+ winDebug
+ ("winClipboardProc - X connection ready, pumping X event queue\n");
}
#ifdef HAS_DEVWINDOWS
@@ -328,14 +332,16 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
if (1)
#endif
{
- /* Process Windows messages */
- if (!winClipboardFlushWindowsMessageQueue(hwnd)) {
- ErrorF("winClipboardProc - "
- "winClipboardFlushWindowsMessageQueue trapped "
- "WM_QUIT message, exiting main loop.\n");
- break;
- }
+ winDebug
+ ("winClipboardProc - /dev/windows ready, pumping Windows message queue\n");
}
+
+#ifdef HAS_DEVWINDOWS
+ if (!(FD_ISSET(iConnectionNumber, &fdsRead)) &&
+ !(FD_ISSET(fdMessageQueue, &fdsRead))) {
+ winDebug("winClipboardProc - Spurious wake, select() returned %d\n", iReturn);
+ }
+#endif
}
winClipboardProc_Exit:
@@ -345,7 +351,7 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
winClipboardProc_Done:
/* Close our Windows window */
if (g_hwndClipboard) {
- winClipboardWindowDestroy();
+ DestroyWindow(g_hwndClipboard);
}
/* Close our X window */
@@ -485,7 +491,7 @@ void
winClipboardWindowDestroy(void)
{
if (g_hwndClipboard) {
- SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0);
+ SendMessage(g_hwndClipboard, WM_WM_QUIT, 0, 0);
}
}