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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user