seat.c: Make clangformat happy and simplify the control flow

This restores the original behaviour from 2cf40f7, is easier to read,
and satisfies clangformat.
This also doesn't call wlr_idle_notify_activity anymore, which was
probably unintended.
This commit is contained in:
Michael Weiss 2020-07-17 13:44:46 +02:00 committed by Jente Hidskes
parent d097393732
commit 7d37322906

9
seat.c
View file

@ -229,13 +229,12 @@ handle_keybinding(struct cg_server *server, xkb_keysym_t sym)
#ifdef DEBUG
if (sym == XKB_KEY_Escape) {
wl_display_terminate(server->wl_display);
} else
return true;
}
#endif
if (server->allow_vt_switch && sym >= XKB_KEY_XF86Switch_VT_1
&& sym <= XKB_KEY_XF86Switch_VT_12) {
if (server->allow_vt_switch && sym >= XKB_KEY_XF86Switch_VT_1 && sym <= XKB_KEY_XF86Switch_VT_12) {
if (wlr_backend_is_multi(server->backend)) {
struct wlr_session *session =
wlr_backend_get_session(server->backend);
struct wlr_session *session = wlr_backend_get_session(server->backend);
if (session) {
unsigned vt = sym - XKB_KEY_XF86Switch_VT_1 + 1;
wlr_session_change_vt(session, vt);