summaryrefslogtreecommitdiff
path: root/kiosk-shell
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2021-11-02 13:41:30 +0200
committerMarius Vlad <marius.vlad@collabora.com>2021-11-12 15:58:43 +0200
commitf8863113535c53fa6afe314b643676460273759b (patch)
treeacd4db081d6c1ded8dae4abb5f9bfed886a891df /kiosk-shell
parent79cf52e5566742bdbf98bce7ad7f61a5e0106448 (diff)
downloadweston-f8863113535c53fa6afe314b643676460273759b.tar.gz
kiosk-shell: ignore additional seats
As kiosk-shell can't cope with multiple seat add a warning and avoid creating any new seats. With it, this guards against potentially receiving an invalid seat. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'kiosk-shell')
-rw-r--r--kiosk-shell/kiosk-shell.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c
index eed0f0aa..f95166c7 100644
--- a/kiosk-shell/kiosk-shell.c
+++ b/kiosk-shell/kiosk-shell.c
@@ -57,9 +57,14 @@ get_kiosk_shell_seat(struct weston_seat *seat)
{
struct wl_listener *listener;
+ if (!seat)
+ return NULL;
+
listener = wl_signal_get(&seat->destroy_signal,
kiosk_shell_seat_handle_destroy);
- assert(listener != NULL);
+
+ if (!listener)
+ return NULL;
return container_of(listener,
struct kiosk_shell_seat, seat_destroy_listener);
@@ -443,6 +448,12 @@ kiosk_shell_seat_create(struct kiosk_shell *shell, struct weston_seat *seat)
{
struct kiosk_shell_seat *shseat;
+ if (wl_list_length(&shell->seat_list) > 0) {
+ weston_log("WARNING: multiple seats detected. kiosk-shell "
+ "can not handle multiple seats!\n");
+ return NULL;
+ }
+
shseat = zalloc(sizeof *shseat);
if (!shseat) {
weston_log("no memory to allocate shell seat\n");