[Bug 15122] Clipboard functions don't work in console applications

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Jun 17 11:03:58 CDT 2009


Yuri Khan <yurivkhan at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |yurivkhan at gmail.com

--- Comment #28 from Yuri Khan <yurivkhan at 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:
    HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, 14);
    wcscpy(static_cast<wchar_t*>(GlobalLock(hMem)), L"Preved");
    SetClipboardData(CF_UNICODETEXT, hMem);

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

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list