From 0183e13f505c0afa7cea9eb5a0873d9596916fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 7 Nov 2021 11:29:25 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20error=20out=20if=20there=20aren?= =?UTF-8?q?=E2=80=99t=20any=20seats=20available?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there aren’t any seats available, input is not possible (neither keyboard nor mouse input). Note that this is not the same thing as e.g. no keyboard being plugged in. In this case, there will be a seat, but without the keybaord capability. Input may not be possible _right now_, but may be later, if the user plugs in a keyboard. Closes #779 --- CHANGELOG.md | 3 +++ wayland.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e409cbf..b4eef6c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,9 @@ `double-width` to `wcswidth`. * INSTALL.md: `--override tweak.grapheme-shaping=no` added to PGO command line. +* Foot now terminates if there are no available seats - for example, + due to the compositor not implementing a recent enough version of + the `wl_seat` interface (https://codeberg.org/dnkl/foot/issues/779). ### Deprecated diff --git a/wayland.c b/wayland.c index 22e3d6dc..44157ab2 100644 --- a/wayland.c +++ b/wayland.c @@ -1238,6 +1238,10 @@ wayl_init(const struct config *conf, struct fdm *fdm) "(wl_data_device_manager not implemented by server)"); goto out; } + if (tll_length(wayl->seats) == 0) { + LOG_ERR("no seats available (wl_seat interface too old?)"); + goto out; + } if (wayl->primary_selection_device_manager == NULL) LOG_WARN("no primary selection available");