diff --git a/hw/xwin/winclipboard/internal.h b/hw/xwin/winclipboard/internal.h index bcf45ca4d..c6bde84af 100644 --- a/hw/xwin/winclipboard/internal.h +++ b/hw/xwin/winclipboard/internal.h @@ -44,6 +44,7 @@ #define WIN_XEVENTS_NOTIFY_TARGETS 4 #define WM_WM_REINIT (WM_USER + 1) +#define WM_WM_QUIT (WM_USER + 2) /* * References to external symbols diff --git a/hw/xwin/winclipboard/thread.c b/hw/xwin/winclipboard/thread.c index 786b88972..50e1e8cb5 100644 --- a/hw/xwin/winclipboard/thread.c +++ b/hw/xwin/winclipboard/thread.c @@ -351,7 +351,7 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay) winClipboardProc_Done: /* Close our Windows window */ if (g_hwndClipboard) { - winClipboardWindowDestroy(); + DestroyWindow(g_hwndClipboard); } /* Close our X window */ @@ -491,7 +491,7 @@ void winClipboardWindowDestroy(void) { if (g_hwndClipboard) { - SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0); + SendMessage(g_hwndClipboard, WM_WM_QUIT, 0, 0); } } diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c index b63a1dc5c..a17f8a900 100644 --- a/hw/xwin/winclipboard/wndproc.c +++ b/hw/xwin/winclipboard/wndproc.c @@ -154,6 +154,12 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ChangeClipboardChain(hwnd, s_hwndNextViewer); s_hwndNextViewer = NULL; + } + return 0; + + case WM_WM_QUIT: + { + winDebug("winClipboardWindowProc - WM_WM_QUIT\n"); PostQuitMessage(0); }