summaryrefslogtreecommitdiff
path: root/hw/xwin/winclipboardwndproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xwin/winclipboardwndproc.c')
-rwxr-xr-xhw/xwin/winclipboardwndproc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 02347ff43..40bdaa978 100755
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -246,6 +246,32 @@ winClipboardWindowProc (HWND hwnd, UINT message,
winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n");
return 0;
+ case WM_WM_DEINIT:
+ {
+ /*
+ Assume the user has changed the selection since we gained
+ focus, so empty the Windows clipboard, to tell Windows that
+ it needs to ask us to render the contents again if anyone asks
+ for it
+ */
+
+ /* Set up for another delayed rendering callback */
+ OpenClipboard (hwnd);
+
+ /* Take ownership of the Windows clipboard */
+ EmptyClipboard ();
+
+ /* Advertise Unicode if we support it */
+ if (g_fUnicodeSupport)
+ SetClipboardData (CF_UNICODETEXT, NULL);
+
+ /* Always advertise regular text */
+ SetClipboardData (CF_TEXT, NULL);
+
+ /* Release the clipboard */
+ CloseClipboard ();
+ }
+ return 0;
case WM_DRAWCLIPBOARD:
{