Try to close the clipboard if it is open before we try to open it.

This commit is contained in:
Harold L Hunt II 2004-03-03 03:08:59 +00:00
parent c7b5484cfe
commit 0c4329a8c4
3 changed files with 19 additions and 1 deletions

View file

@ -323,7 +323,13 @@ winClipboardWindowProc (HWND hwnd, UINT message,
if (message == WM_RENDERALLFORMATS)
{
/* We must open and empty the clipboard */
/* Close clipboard if we have it open already */
if (GetOpenClipboardWindow () == hwnd)
{
CloseClipboard ();
}
if (!OpenClipboard (hwnd))
{
ErrorF ("winClipboardWindowProc - WM_RENDER*FORMATS - "

View file

@ -459,6 +459,12 @@ winProcSetSelectionOwner (ClientPtr client)
goto winProcSetSelectionOwner_Done;
}
/* Close clipboard if we have it open already */
if (GetOpenClipboardWindow () == g_hwndClipboard)
{
CloseClipboard ();
}
/* Access the Windows clipboard */
if (!OpenClipboard (g_hwndClipboard))
{

View file

@ -193,6 +193,12 @@ winClipboardFlushXEvents (HWND hwnd,
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
/* Close clipboard if we have it open already */
if (GetOpenClipboardWindow () == hwnd)
{
CloseClipboard ();
}
/* Access the clipboard */
if (!OpenClipboard (hwnd))
{