diff options
Diffstat (limited to 'src/im.lua')
| -rw-r--r-- | src/im.lua | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -315,11 +315,13 @@ function im.begin_window(title, x, y, w, h, opts) end if mouse_down and focused_win == win then - local last = pop(wins) - wins[win.idx] = last - last.idx = win.idx - table.insert(wins, win) - win.idx = #wins + if wins[#wins] ~= win then + local last = table.remove(wins) + wins[win.idx] = last + last.idx = win.idx + table.insert(wins, win) + win.idx = #wins + end end end |
