From ce2dbea510b60e1a9f1e62b607dea62cce898e03 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 15 Aug 2019 01:45:01 -0400 Subject: [PATCH] shims: Avoid a race condition when setting the mouse screen. --- tests/examples/shims/screen.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/examples/shims/screen.lua b/tests/examples/shims/screen.lua index a84cf2a2..a84c0796 100644 --- a/tests/examples/shims/screen.lua +++ b/tests/examples/shims/screen.lua @@ -35,7 +35,8 @@ local function create_screen(args) local wa = args.workarea_sides or 10 -- This will happen if `clear()` is called - if mouse and not mouse.screen then + if mouse and (screen.count() > 0 and not mouse.screen) then + screen[s] = s mouse.screen = s end