From 46170580b2ca7c2d484f9095f1ecd92c0a4ac04f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 26 Nov 2022 20:16:42 +0100 Subject: [PATCH] Make session optional --- include/sway/server.h | 1 - sway/input/keyboard.c | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/sway/server.h b/include/sway/server.h index 6f29b3f5..309d9d3e 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 0b90b6af..2ac02b22 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -1,8 +1,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -16,6 +16,10 @@ #include "sway/ipc-server.h" #include "log.h" +#if WLR_HAS_SESSION +#include +#endif + static struct modifier_key { char *name; uint32_t mod; @@ -264,10 +268,12 @@ static bool keyboard_execute_compositor_binding(struct sway_keyboard *keyboard, xkb_keysym_t keysym = pressed_keysyms[i]; if (keysym >= XKB_KEY_XF86Switch_VT_1 && keysym <= XKB_KEY_XF86Switch_VT_12) { +#if WLR_HAS_SESSION if (server.session) { unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; wlr_session_change_vt(server.session, vt); } +#endif return true; } }