Fl::copy() would always set a flag, instructing Fl::paste to use the internal clipboard. ALthough that is faster, Fl::paste() would eventually miss changes to the external clipboard.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4387 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-06-01 07:48:16 +00:00
parent 04c67e441e
commit df32d2a9b8
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR - Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745) #744, STR #745)
- Fl::paste would sometimes not recoginze external
changes of the clipboard (STR #722)
- Clipping fixes for OSX - Clipping fixes for OSX
- Removed attempt to find items via - Removed attempt to find items via
Fl_Menu_::find_item() in linked submenus Fl_Menu_::find_item() in linked submenus

View File

@ -384,12 +384,16 @@ void Fl::copy(const char *stuff, int len, int clipboard) {
if (clipboard) { if (clipboard) {
// set up for "delayed rendering": // set up for "delayed rendering":
if (OpenClipboard(fl_xid(Fl::first_window()))) { if (OpenClipboard(fl_xid(Fl::first_window()))) {
// if the system clipboard works, use it
EmptyClipboard(); EmptyClipboard();
SetClipboardData(CF_TEXT, NULL); SetClipboardData(CF_TEXT, NULL);
CloseClipboard(); CloseClipboard();
} fl_i_own_selection[clipboard] = 0;
} else {
// only if it fails, instruct paste() to use the internal buffers
fl_i_own_selection[clipboard] = 1; fl_i_own_selection[clipboard] = 1;
} }
}
} }
// Call this when a "paste" operation happens: // Call this when a "paste" operation happens: