mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 02:28:08 +02:00
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:
parent
79cf52e556
commit
f886311353
1 changed files with 12 additions and 1 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue