Fixed dnd when just folder in target dir but not highlighted causing incorrect drop target

This commit is contained in:
itdominator 2022-12-02 22:10:41 -06:00
parent b84fd38523
commit 8c595bdf0c
1 changed files with 13 additions and 8 deletions

View File

@ -256,11 +256,16 @@ class WindowMixin(TabMixin):
target = icons_grid.get_name() target = icons_grid.get_name()
wid, tid = target.split("|") wid, tid = target.split("|")
store = icons_grid.get_model() store = icons_grid.get_model()
treePath = icons_grid.get_drag_dest_item().path path_at_loc = None
if treePath: try:
uri = self.format_to_uris(store, wid, tid, treePath)[0].replace("file://", "") path_at_loc = icons_grid.get_item_at_pos(x, y)[0]
highlighted_item_path = icons_grid.get_drag_dest_item().path
if path_at_loc and path_at_loc == highlighted_item_path:
uri = self.format_to_uris(store, wid, tid, highlighted_item_path)[0].replace("file://", "")
self.override_drop_dest = uri if isdir(uri) else None self.override_drop_dest = uri if isdir(uri) else None
except Exception as e:
...
if target not in current: if target not in current:
self.fm_controller.set_wid_and_tid(wid, tid) self.fm_controller.set_wid_and_tid(wid, tid)