Harden drag handler: check data/text and recover
This commit is contained in:
parent
5cd4c22764
commit
20c4b5d177
|
|
@ -288,13 +288,19 @@ func setupDragDest(p *pane, win *gtk.Window) {
|
||||||
if data == nil {
|
if data == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uris := data.GetURIs()
|
var path string
|
||||||
if len(uris) == 0 {
|
if uris := data.GetURIs(); len(uris) > 0 {
|
||||||
|
path = uriToPath(uris[0])
|
||||||
|
}
|
||||||
|
if path == "" {
|
||||||
|
if txt := data.GetText(); txt != "" {
|
||||||
|
path = uriToPath(txt)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if path == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if path := uriToPath(uris[0]); path != "" {
|
loadIntoPane(p, path)
|
||||||
loadIntoPane(p, path)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user