shims: Avoid a race condition when setting the mouse screen.

This commit is contained in:
Emmanuel Lepage Vallee 2019-08-15 01:45:01 -04:00
parent f7c0f419e9
commit ce2dbea510
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ local function create_screen(args)
local wa = args.workarea_sides or 10 local wa = args.workarea_sides or 10
-- This will happen if `clear()` is called -- 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 mouse.screen = s
end end