mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 17:01:29 +00:00
Make session optional
This commit is contained in:
parent
e795ea6a0c
commit
46170580b2
|
@ -3,7 +3,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
#include <wlr/backend.h>
|
#include <wlr/backend.h>
|
||||||
#include <wlr/backend/session.h>
|
|
||||||
#include <wlr/render/allocator.h>
|
#include <wlr/render/allocator.h>
|
||||||
#include <wlr/render/wlr_renderer.h>
|
#include <wlr/render/wlr_renderer.h>
|
||||||
#include <wlr/types/wlr_compositor.h>
|
#include <wlr/types/wlr_compositor.h>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#include <wlr/config.h>
|
||||||
#include <wlr/backend/multi.h>
|
#include <wlr/backend/multi.h>
|
||||||
#include <wlr/backend/session.h>
|
|
||||||
#include <wlr/interfaces/wlr_keyboard.h>
|
#include <wlr/interfaces/wlr_keyboard.h>
|
||||||
#include <wlr/types/wlr_idle.h>
|
#include <wlr/types/wlr_idle.h>
|
||||||
#include <wlr/types/wlr_keyboard.h>
|
#include <wlr/types/wlr_keyboard.h>
|
||||||
|
@ -16,6 +16,10 @@
|
||||||
#include "sway/ipc-server.h"
|
#include "sway/ipc-server.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
#if WLR_HAS_SESSION
|
||||||
|
#include <wlr/backend/session.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct modifier_key {
|
static struct modifier_key {
|
||||||
char *name;
|
char *name;
|
||||||
uint32_t mod;
|
uint32_t mod;
|
||||||
|
@ -264,10 +268,12 @@ static bool keyboard_execute_compositor_binding(struct sway_keyboard *keyboard,
|
||||||
xkb_keysym_t keysym = pressed_keysyms[i];
|
xkb_keysym_t keysym = pressed_keysyms[i];
|
||||||
if (keysym >= XKB_KEY_XF86Switch_VT_1 &&
|
if (keysym >= XKB_KEY_XF86Switch_VT_1 &&
|
||||||
keysym <= XKB_KEY_XF86Switch_VT_12) {
|
keysym <= XKB_KEY_XF86Switch_VT_12) {
|
||||||
|
#if WLR_HAS_SESSION
|
||||||
if (server.session) {
|
if (server.session) {
|
||||||
unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1;
|
unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1;
|
||||||
wlr_session_change_vt(server.session, vt);
|
wlr_session_change_vt(server.session, vt);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue