diff options
author | 2022-11-26 20:16:42 +0100 | |
---|---|---|
committer | 2022-11-28 13:28:15 -0500 | |
commit | 46170580b2ca7c2d484f9095f1ecd92c0a4ac04f (patch) | |
tree | 53b4bcf9fe4feb15102c44a4e7b2e7ecf43b23f7 | |
parent | Make DRM backend optional (diff) | |
download | sway-46170580b2ca7c2d484f9095f1ecd92c0a4ac04f.tar.gz sway-46170580b2ca7c2d484f9095f1ecd92c0a4ac04f.tar.zst sway-46170580b2ca7c2d484f9095f1ecd92c0a4ac04f.zip |
Make session optional
-rw-r--r-- | include/sway/server.h | 1 | ||||
-rw-r--r-- | 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 @@ | |||
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | #include <wayland-server-core.h> | 4 | #include <wayland-server-core.h> |
5 | #include <wlr/backend.h> | 5 | #include <wlr/backend.h> |
6 | #include <wlr/backend/session.h> | ||
7 | #include <wlr/render/allocator.h> | 6 | #include <wlr/render/allocator.h> |
8 | #include <wlr/render/wlr_renderer.h> | 7 | #include <wlr/render/wlr_renderer.h> |
9 | #include <wlr/types/wlr_compositor.h> | 8 | #include <wlr/types/wlr_compositor.h> |
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 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | #include <limits.h> | 2 | #include <limits.h> |
3 | #include <strings.h> | 3 | #include <strings.h> |
4 | #include <wlr/config.h> | ||
4 | #include <wlr/backend/multi.h> | 5 | #include <wlr/backend/multi.h> |
5 | #include <wlr/backend/session.h> | ||
6 | #include <wlr/interfaces/wlr_keyboard.h> | 6 | #include <wlr/interfaces/wlr_keyboard.h> |
7 | #include <wlr/types/wlr_idle.h> | 7 | #include <wlr/types/wlr_idle.h> |
8 | #include <wlr/types/wlr_keyboard.h> | 8 | #include <wlr/types/wlr_keyboard.h> |
@@ -16,6 +16,10 @@ | |||
16 | #include "sway/ipc-server.h" | 16 | #include "sway/ipc-server.h" |
17 | #include "log.h" | 17 | #include "log.h" |
18 | 18 | ||
19 | #if WLR_HAS_SESSION | ||
20 | #include <wlr/backend/session.h> | ||
21 | #endif | ||
22 | |||
19 | static struct modifier_key { | 23 | static struct modifier_key { |
20 | char *name; | 24 | char *name; |
21 | uint32_t mod; | 25 | uint32_t mod; |
@@ -264,10 +268,12 @@ static bool keyboard_execute_compositor_binding(struct sway_keyboard *keyboard, | |||
264 | xkb_keysym_t keysym = pressed_keysyms[i]; | 268 | xkb_keysym_t keysym = pressed_keysyms[i]; |
265 | if (keysym >= XKB_KEY_XF86Switch_VT_1 && | 269 | if (keysym >= XKB_KEY_XF86Switch_VT_1 && |
266 | keysym <= XKB_KEY_XF86Switch_VT_12) { | 270 | keysym <= XKB_KEY_XF86Switch_VT_12) { |
271 | #if WLR_HAS_SESSION | ||
267 | if (server.session) { | 272 | if (server.session) { |
268 | unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; | 273 | unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; |
269 | wlr_session_change_vt(server.session, vt); | 274 | wlr_session_change_vt(server.session, vt); |
270 | } | 275 | } |
276 | #endif | ||
271 | return true; | 277 | return true; |
272 | } | 278 | } |
273 | } | 279 | } |