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>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user