1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-09 23:18:31 -04:00

clipboard: store text alongside image when both are offered

related #2849
port 1.5
This commit is contained in:
bbedward
2026-07-13 18:23:00 -04:00
parent 25847c3f03
commit bb0be2b215
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
}