http://bugs.winehq.org/show_bug.cgi?id=15122
Yuri Khan yurivkhan@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yurivkhan@gmail.com
--- Comment #28 from Yuri Khan yurivkhan@gmail.com 2009-06-17 11:03:53 --- This issue is not limited to console applications. It affects any application that does not run a message loop or otherwise cause X11DRV_MsgWaitForMultipleObjectsEx to be called. I have tested an application which has this in its message loop:
case IDM_TEST: { OpenClipboard(0); EmptyClipboard(); HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, 14); wcscpy(static_cast<wchar_t*>(GlobalLock(hMem)), L"Preved"); GlobalUnlock(hMem); SetClipboardData(CF_UNICODETEXT, hMem); CloseClipboard(); Sleep(60000); break; }
In Windows, it copies the data to the system immediately, and then fails to process messages for a minute. Meanwhile, paste operations succeed.
In wine, the clipboard data is not available until this minute passes.
I studied the code of OpenClipboard and found that in case when hWnd is 0 or does not belong to the calling thread, wine creates its own auxiliary window to act as the selection owner. This leads me to an idea that it should also spin an auxiliary thread that would run an X message loop and respond to selection requests.