fix: handle slight delay in availability of clipboard data

a better fix in the future would probably be an event indicating availability of the data.
This commit is contained in:
Ashley Wulber 2026-03-26 13:21:17 -04:00 committed by Jacob Kauffmann
parent 175f8ba724
commit cf328771c3
2 changed files with 36 additions and 10 deletions

View file

@ -133,9 +133,7 @@ impl TryFrom<(Vec<u8>, String)> for ClipboardPaste {
"text/uri-list" => {
let text = str::from_utf8(&data)?;
let lines = text.lines();
if text.is_empty() || lines.count() == 0 {
Err(format!("Empty file url"))?;
}
for line in text.lines() {
let url = Url::parse(line)?;
match url.to_file_path() {
@ -146,10 +144,7 @@ impl TryFrom<(Vec<u8>, String)> for ClipboardPaste {
}
"x-special/gnome-copied-files" => {
let text = str::from_utf8(&data)?;
let lines = text.lines();
if text.is_empty() || lines.count() == 0 {
Err(format!("Empty file url"))?;
}
for (i, line) in text.lines().enumerate() {
if i == 0 {
kind = match line {