[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


http://bugs.winehq.org/show_bug.cgi?id=15122


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:
{
    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.

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