Skip to content

Commit

Permalink
In Windows, images copied from browser (Chrome, Firefox) can be paste…
Browse files Browse the repository at this point in the history
…d immediately

 - no need to parse HTML and download them again
  • Loading branch information
DaPa committed Jul 5, 2023
1 parent 26db493 commit a36ccd5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ct/ct_clipboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ void CtClipboard::_paste_clipboard(Gtk::TextView* pTextView, CtCodebox* /*pCodeb
if (vec::exists(targets, CtConst::TARGET_CTD_TABLE))
return std::make_tuple(CtConst::TARGET_CTD_TABLE, received_table, false);
#if defined(_WIN32)
// on Windows, if the web clipboard is an image then paste it immediately (no html download needed)
for (auto& target : CtConst::TARGETS_IMAGES)
if (vec::exists(targets, target))
return std::make_tuple(target, received_image, false);
if (vec::exists(targets, CtConst::TARGET_WIN_HTML))
return std::make_tuple(CtConst::TARGET_WIN_HTML, received_html, false);
#endif // _WIN32
Expand Down

0 comments on commit a36ccd5

Please sign in to comment.