lua-shell: Use local pd to store background curtains

This avoids hitting the assert that we don't have any paint nodes in
available when the repaint loop starts.

As we only have just a single curtain, in multi-head/outputs case a new
output creation will destroy the previous curtain and we'll end up
hitting the empty paint nodes assert.

Note that this doesn't add any functionality it just makes sure we're actually
capable of running the lua-shell rather than dying.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2026-01-08 15:41:56 +02:00
parent 2543ec3f54
commit 99f3a92f4a

View file

@ -2,7 +2,6 @@ background_layer = {}
normal_layer = {}
hidden_layer = {}
fullscreen_layer = {}
background_curtain = nil
current_width = 0
current_height = 0
@ -69,32 +68,32 @@ end
function recreate_background(output)
local x, y = output:get_position()
local w, h = output:get_dimensions()
local pd = output:get_private()
if (background_curtain ~= nil) then
background_curtain:dispose()
if (pd.curtain ~= nil) then
pd.curtain:dispose()
end
background_curtain = weston:create_curtain("output curtain")
background_curtain:set_color(0xFF000000)
background_curtain:set_position(x, y)
background_curtain:set_dimensions(w, h)
background_curtain:set_capture_input(true)
bv = background_curtain:get_view()
pd.curtain = weston:create_curtain("output curtain")
pd.curtain:set_color(0xFF000000)
pd.curtain:set_position(x, y)
pd.curtain:set_dimensions(w, h)
pd.curtain:set_capture_input(true)
local bv = pd.curtain:get_view()
bv:set_output(output)
bv:set_layer(background_layer)
end
function my_output_create(output)
local pd = { has_fullscreen_view = false }
local pd = { has_fullscreen_view = false, curtain = nil }
if (primary_output == nil) then
primary_output = output
end
recreate_background(output)
pd.background_view = bv
output:set_private(pd)
recreate_background(output)
-- Must set ready or no repaints will take place
output:set_ready()