From 67eab4010c38f06c96307e66e5071380e95bdb7d Mon Sep 17 00:00:00 2001 From: Harold L Hunt II Date: Thu, 8 Jan 2004 07:14:48 +0000 Subject: [PATCH] Additional fix for Unicode clipboard support. --- hw/xwin/winclipboard.h | 5 ++++- hw/xwin/winclipboardthread.c | 4 ++-- hw/xwin/winclipboardwndproc.c | 9 +++++---- hw/xwin/winclipboardxevents.c | 9 ++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h index 842127d22..7bc63fba3 100644 --- a/hw/xwin/winclipboard.h +++ b/hw/xwin/winclipboard.h @@ -70,6 +70,9 @@ #define WIN_JMP_OKAY 0 #define WIN_JMP_ERROR_IO 2 #define WIN_LOCAL_PROPERTY "CYGX_CUT_BUFFER" +#define WIN_XEVENTS_SUCCESS 0 +#define WIN_XEVENTS_SHUTDOWN 1 +#define WIN_XEVENTS_CONVERT 2 /* @@ -174,7 +177,7 @@ winClipboardWindowProc (HWND hwnd, UINT message, * winclipboardxevents.c */ -Bool +int winClipboardFlushXEvents (HWND hwnd, int iWindow, Display *pDisplay, diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index 88835ca54..0104e5eef 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -350,11 +350,11 @@ winClipboardProc (void *pArg) /* Process X events */ /* Exit when we see that server is shutting down */ - fReturn = winClipboardFlushXEvents (hwnd, + iReturn = winClipboardFlushXEvents (hwnd, iWindow, pDisplay, fUnicodeSupport); - if (!fReturn) + if (WIN_XEVENTS_SHUTDOWN == iReturn) { ErrorF ("winClipboardProc - winClipboardFlushXEvents " "trapped shutdown event, exiting main loop.\n"); diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c index 8e55ad3e7..bad9209d3 100644 --- a/hw/xwin/winclipboardwndproc.c +++ b/hw/xwin/winclipboardwndproc.c @@ -262,10 +262,11 @@ winClipboardWindowProc (HWND hwnd, UINT message, } /* Process the SelectionNotify event */ - if (!winClipboardFlushXEvents (hwnd, - iWindow, - pDisplay, - g_fUnicodeSupport)) + iReturn = winClipboardFlushXEvents (hwnd, + iWindow, + pDisplay, + g_fUnicodeSupport); + if (WIN_XEVENTS_CONVERT == iReturn) { /* * The selection was offered for conversion first, so we have diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c index 9099a5270..f5294e79a 100644 --- a/hw/xwin/winclipboardxevents.c +++ b/hw/xwin/winclipboardxevents.c @@ -36,7 +36,7 @@ * Process any pending X events */ -Bool +int winClipboardFlushXEvents (HWND hwnd, int iWindow, Display *pDisplay, @@ -50,7 +50,6 @@ winClipboardFlushXEvents (HWND hwnd, char *pszGlobalData = NULL; int iReturn; HGLOBAL hGlobal; - Bool fReturn = TRUE; XICCEncodingStyle xiccesStyle; int iConvertDataLen = 0; char *pszConvertData = NULL; @@ -400,7 +399,7 @@ winClipboardFlushXEvents (HWND hwnd, /* Process the ConvertSelection event */ XFlush (pDisplay); - break; + return WIN_XEVENTS_CONVERT; } else if (event.xselection.target == atomCompoundText) { @@ -423,7 +422,7 @@ winClipboardFlushXEvents (HWND hwnd, /* Process the ConvertSelection event */ XFlush (pDisplay); - break; + return WIN_XEVENTS_CONVERT; } else { @@ -644,5 +643,5 @@ winClipboardFlushXEvents (HWND hwnd, } } - return fReturn; + return WIN_XEVENTS_SUCCESS; }