Commit graph

6 commits

Author SHA1 Message Date
Marius Vlad
99f3a92f4a 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>
2026-01-09 22:12:47 +02:00
Derek Foreman
0bfcb700b9 compositor/shells: Require shells to flag outputs as ready to allow repaint
We've added a curtain to the shells so at startup we have something to
render, but this causes a flicker if someone is trying to have a seamless
transition from boot to weston.

Add a ready flag that allows the shell to indicate repaints are safe, so
we can remove the curtains and have no wasted frames at startup.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-27 05:55:51 +00:00
Philipp Zabel
de3a3fca1b shell.lua: Fix layer link assertions
Replace two always-true assertions:

        weston_assert_true(wc, &other_shview->view->layer_link.layer);

with what seems to have been the intended check:

        weston_assert_ptr_not_null(wc, other_shview->view->layer_link.layer);

This fixes a build warning:

  .../lua-shell/lua-shell.c: In function 'lua_shell_env_view_move_behind_other_view':
  .../lua-shell/lua-shell.c:1466:1: warning: the comparison will always evaluate as 'true' for the address of 'layer' will never be NULL [-Waddress]
  In file included from .../include/libweston/desktop.h:27,
                   from .../lua-shell/lua-shell.h:27,
                   from .../lua-shell/lua-shell.c:33:
  .../include/libweston/libweston.h:1112:23: note: 'layer' declared here
  .../lua-shell/lua-shell.c: In function 'lua_shell_env_view_move_in_front_of_other_view':
  .../lua-shell/lua-shell.c:1482:1: warning: the comparison will always evaluate as 'true' for the address of 'layer' will never be NULL [-Waddress]
  .../include/libweston/libweston.h:1112:23: note: 'layer' declared here

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2025-10-09 13:45:47 +02:00
Marius Vlad
8618a29649 shell.lua: Add output_resized callback handler
When resizing the outputs, re-create the background and relayout the
views according to the (newer) output dimensions.

This is a common feature amongs our shells, so do this for lua-shell as
well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-07-08 22:48:19 +03:00
Marius Vlad
56b768d934 shell.lua: Add a helper to re-create background
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-07-08 22:47:46 +03:00
Derek Foreman
e91eccd709 lua-shell: Add lua-shell
lua-shell is a new meta-shell for Weston. It does nothing in and of
itself, but is defined to be user-scriptable and configurable. A
supplied Lua script will be interpreted and executed by Weston, allowing
full control over window management in response to events.

This includes a shell.lua example script which behaves as a tiling WM.

Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Co-authored-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-04 15:47:06 +03:00