aboutsummaryrefslogtreecommitdiff
path: root/src/im.lua
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-12 15:34:21 -0400
committeriamcheeseman <[email protected]>2026-03-12 15:34:21 -0400
commita73cc7bc2fb11f7099a59eafc73e2161bf807a84 (patch)
tree5da51390d59b5e3df80b648783fc1dea4483a192 /src/im.lua
parentbea27cd7f979ce3544b4c73855190efc2a9565ac (diff)
fix silly lil bug causing mener to cry
Diffstat (limited to 'src/im.lua')
-rw-r--r--src/im.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/im.lua b/src/im.lua
index 28c7064..7602765 100644
--- a/src/im.lua
+++ b/src/im.lua
@@ -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