1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-09 06:58:29 -04:00

clipboard: store text alongside image when both are offered

related #2849
port 1.5

(cherry picked from commit bb0be2b215)
This commit is contained in:
bbedward
2026-07-13 18:23:00 -04:00
committed by dms-ci[bot]
parent 928b272628
commit d87e2fcb01
4 changed files with 240 additions and 48 deletions
+12 -10
View File
@@ -138,20 +138,22 @@ func handleCopyEntry(conn net.Conn, req models.Request, m *Manager) {
return
}
filePath := m.EntryToFile(entry)
if filePath != "" {
if err := m.CopyFile(filePath); err != nil {
models.RespondError(conn, req.ID, err.Error())
if entry.AltMimeType == "" {
filePath := m.EntryToFile(entry)
if filePath != "" {
if err := m.CopyFile(filePath); err != nil {
models.RespondError(conn, req.ID, err.Error())
return
}
models.Respond(conn, req.ID, map[string]any{
"success": true,
"filePath": filePath,
})
return
}
models.Respond(conn, req.ID, map[string]any{
"success": true,
"filePath": filePath,
})
return
}
if err := m.SetClipboard(entry.Data, entry.MimeType); err != nil {
if err := m.SetClipboardEntry(entry); err != nil {
models.RespondError(conn, req.ID, err.Error())
return
}