summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-09-12 23:51:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-09-12 23:51:36 +0000
commitc526a7ad2f4b31a6342edb888c8a1925365821ce (patch)
treed3bc3c55c5ba0790436048029bbaa07a0cd1289b /src
parentfe934da8b251a3845cfcbad22a4ab02ede5cfafe (diff)
Clipboard will persist if owner window is hidden (STR #1019)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4565 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 6245a50df..a41f344a5 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -849,6 +849,16 @@ void Fl_Window::hide() {
handle(FL_HIDE);
#ifdef WIN32
+ // this little trick keeps the current clipboard alive, even if we are about
+ // to destroy the window that owns the selection.
+ if (GetClipboardOwner()==ip->xid) {
+ Fl_Window *w1 = Fl::first_window();
+ if (w1 && OpenClipboard(fl_xid(w1))) {
+ EmptyClipboard();
+ SetClipboardData(CF_TEXT, NULL);
+ CloseClipboard();
+ }
+ }
// Send a message to myself so that I'll get out of the event loop...
PostMessage(ip->xid, WM_APP, 0, 0);
if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc);