Merge pull request #9078 from dotCooCoo/fix/paste-keeps-unwritten-cut

Clipboard: Paste keeps a Copy or Cut whose system clipboard write failed
This commit is contained in:
BFlat authored and GitHub committed 2026-11-26 16:59:28 +07:00
commit d7982ef857
6 files changed
+270 -28

No files matched your search

+3 -1
View File
@@ -816,7 +816,9 @@ lists to the system clipboard (once they are written, the status bar shows the f
another message has replaced the Copy or Cut's meanwhile), and every Paste command first loads what another app copied (`clipboard.importSvg`,
`importPdf`, `importEps`, `importText` or `importImage`, centred in the view; the desktop app reads PDF and EPS from
the Windows clipboard and, with SVG, from the macOS pasteboard, and an `.eps` file, or a `.ai` or `.ait` file that holds a PDF or PostScript, copied in a file manager anywhere; a copied `.ai` or `.ait` file that holds a PDF loads with `importPdf {editingData: true}`, which reads its editing data); an import error answers the Paste with that error
and pastes nothing. Cmd+V also pastes a bitmap or PDF with no text beside it (on the key's release, as egui sends no
and pastes nothing. After a Copy or Cut whose formats could not be written to the system clipboard, every Paste
command takes the internal clipboard instead until another app copies something (only while the clipboard held text
that could be read when the write failed). Cmd+V also pastes a bitmap or PDF with no text beside it (on the key's release, as egui sends no
Paste event for it). Screenshots paste on every platform: Windows reads `PNG`, else `CF_DIBV5`/`CF_DIB`, macOS the
pasteboard's PNG or TIFF, Linux `image/png`, and the web the picture the browser's paste event carries (#457).
In the desktop app a Paste from the menus or the keys (`ui.key`) decodes a bitmap off the UI thread: `ui.inspect` lists
+7 -2
View File
@@ -10379,8 +10379,13 @@ copied (SVG, then PDF, then text, then a bitmap; SVG markup in text counts as SV
formats and they are published when they are ready. While that thread has a save, an export, a print or a recovery
copy to finish, Copy and Cut make and publish them at once. When another Copy or Cut, or a copy of text in
VectorCraft, comes first, they are dropped. Pasting what VectorCraft copied keeps the lossless internal clipboard,
also before its formats are published. While a text field or the Type tool has the keyboard, the app waits for
them. Windows carries every format both ways and pastes a bitmap from PNG, else
also before its formats are published. When the formats could not be written (another app held the clipboard open
or refused the write), every Paste takes the internal clipboard until another app copies something, and a paste
into a text field or type takes the copy's text, or nothing when the formats have no text. The app notices that
copy only when it changes the clipboard's text, so Paste reads the system clipboard when it held only a picture, or
nothing that could be read, at the failed write. Once a paste has read the changed text, the older text coming back
does not restore the copy. While a
text field or the Type tool has the keyboard, the app waits for them. Windows carries every format both ways and pastes a bitmap from PNG, else
from the device-independent bitmap screenshots copy (`CF_DIBV5`, then `CF_DIB`; alpha kept, opaque when it is zero
throughout, at most 32768 px a side); macOS and Linux carry one format (the text, else the PNG) and paste text and
bitmaps (macOS the pasteboard's PNG, else TIFF, as screenshots copy them). A Paste from the menus or the keys decodes