diff options
| author | Pierre Ossman <ossman@cendio.se> | 2013-09-11 11:11:22 +0000 |
|---|---|---|
| committer | Pierre Ossman <ossman@cendio.se> | 2013-09-11 11:11:22 +0000 |
| commit | 9ce5d7c2ad32681719a513052e98a3723c2ab1f5 (patch) | |
| tree | 056cf07596ee75753cb2638b5b6defa0bb9682f2 /src/Fl.cxx | |
| parent | 6755a24ce3dbabea3e7a49aa4f4e0e34b0b81c95 (diff) | |
Simplify clipboard handling on Windows by consolidating
it into one central function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9972 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 560a26028..a0fcbd9f3 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1357,7 +1357,9 @@ int Fl::handle_(int e, Fl_Window* window) //////////////////////////////////////////////////////////////// // hide() destroys the X window, it does not do unmap! -#if !defined(WIN32) && USE_XFT +#if defined(WIN32) +extern void fl_update_clipboard(void); +#elif USE_XFT extern void fl_destroy_xft_draw(Window); #endif @@ -1404,14 +1406,8 @@ void Fl_Window::hide() { #if defined(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(); - } - } + if (GetClipboardOwner()==ip->xid) + fl_update_clipboard(); // 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); |
