tinywl: fix focus issue when only one toplevel exists

Previously, Alt+F1 would not focus the only one toplevel
when that toplevel lacked focus.
This commit is contained in:
qaqland 2026-02-10 22:33:35 +08:00
parent 436bcf9a47
commit 1f880d41ba

View file

@ -185,7 +185,7 @@ static bool handle_keybinding(struct tinywl_server *server, xkb_keysym_t sym) {
break;
case XKB_KEY_F1:
/* Cycle to the next toplevel */
if (wl_list_length(&server->toplevels) < 2) {
if (wl_list_empty(&server->toplevels)) {
break;
}
struct tinywl_toplevel *next_toplevel =