New try at Unicode clipboard fix.

This commit is contained in:
Harold L Hunt II 2004-01-09 06:24:25 +00:00
parent cfe26c249a
commit da04c87904
3 changed files with 14 additions and 5 deletions

View file

@ -215,11 +215,18 @@ winClipboardWindowProc (HWND hwnd, UINT message,
int iReturn;
Display *pDisplay = *(pWindowProp->ppClipboardDisplay);
Window iWindow = *(pWindowProp->piClipboardWindow);
Bool fConvertToUnicode;
#if 0
ErrorF ("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n");
#endif
/* Flag whether to convert to Unicode or not */
if (message == WM_RENDERALLFORMATS)
fConvertToUnicode = FALSE;
else
fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam);
/* Request the selection contents */
iReturn = XConvertSelection (pDisplay,
*(pWindowProp->patomLastOwnedSelection),
@ -265,7 +272,7 @@ winClipboardWindowProc (HWND hwnd, UINT message,
iReturn = winClipboardFlushXEvents (hwnd,
iWindow,
pDisplay,
g_fUnicodeSupport);
fConvertToUnicode);
if (WIN_XEVENTS_CONVERT == iReturn)
{
/*
@ -280,7 +287,7 @@ winClipboardWindowProc (HWND hwnd, UINT message,
winClipboardFlushXEvents (hwnd,
iWindow,
pDisplay,
g_fUnicodeSupport);
fConvertToUnicode);
}
/* Special handling for WM_RENDERALLFORMATS */

View file

@ -475,11 +475,12 @@ winProcSetSelectionOwner (ClientPtr client)
goto winProcSetSelectionOwner_Done;
}
/* Setup supported clipboard formats */
/* Advertise Unicode if we support it */
if (g_fUnicodeSupport)
SetClipboardData (CF_UNICODETEXT, NULL);
else
SetClipboardData (CF_TEXT, NULL);
/* Always advertise regular text */
SetClipboardData (CF_TEXT, NULL);
/* Save handle to last owned selection */
pScreenPriv->atomLastOwnedSelection = stuff->selection;

View file

@ -365,6 +365,7 @@ winClipboardFlushXEvents (HWND hwnd,
XFree (pszAtomName);
}
/*
* Request conversion of UTF8 and CompoundText targets.
*/