From bcc6264cd4289b077a96fb256abfedbf535cdae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Sun, 29 May 2022 14:47:34 +0200 Subject: [PATCH] Remove screen from stack when unregistered Fixes #87 --- monarch/monarch.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/monarch/monarch.lua b/monarch/monarch.lua index 588cf16..808e11c 100644 --- a/monarch/monarch.lua +++ b/monarch/monarch.lua @@ -298,6 +298,12 @@ function M.unregister(id) log("unregister()", id) local screen = screens[id] screens[id] = nil + -- remove screen from stack + for i = #stack, 1, -1 do + if stack[i].id == id then + table.remove(stack, i) + end + end end local function acquire_input(screen)