diff options
| author | Takase <20792268+takase1121@users.noreply.github.com> | 2024-06-23 13:09:07 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-23 13:09:07 +0800 |
| commit | 6cbfa44c958dd2be5db3e2fe91a39a2a6991d29a (patch) | |
| tree | 1b0b0c4ed683c80d9299381f215e20bda754c29d /data | |
| parent | 74fcd19ac2b51c0e8b2a6cdc0e49f5d04e651db0 (diff) | |
| download | lite-xl-6cbfa44c958dd2be5db3e2fe91a39a2a6991d29a.tar.gz lite-xl-6cbfa44c958dd2be5db3e2fe91a39a2a6991d29a.zip | |
core/rootview: fix dnd multiple folders into dock (#1828)
Diffstat (limited to 'data')
| -rw-r--r-- | data/core/rootview.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 965203fe..06e3c28f 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -27,7 +27,7 @@ function RootView:new() self.grab = nil -- = {view = nil, button = nil} self.overlapping_view = nil self.touched_view = nil - self.first_update_done = false + self.first_dnd_processed = false end @@ -377,7 +377,7 @@ function RootView:on_file_dropped(filename, x, y) if result then return result end local info = system.get_file_info(filename) if info and info.type == "dir" then - if self.first_update_done then + if self.first_dnd_processed then -- first update done, open in new window system.exec(string.format("%q %q", EXEFILE, filename)) else @@ -385,6 +385,7 @@ function RootView:on_file_dropped(filename, x, y) core.confirm_close_docs(core.docs, function(dirpath) core.open_folder_project(dirpath) end, system.absolute_path(filename)) + self.first_dnd_processed = true end else local ok, doc = core.try(core.open_doc, filename) @@ -482,7 +483,9 @@ function RootView:update() self:update_drag_overlay() self:interpolate_drag_overlay(self.drag_overlay) self:interpolate_drag_overlay(self.drag_overlay_tab) - self.first_update_done = true + -- set this to true because at this point there are no dnd requests + -- that are caused by the initial dnd into dock user action + self.first_dnd_processed = true end |
