From 7b523884249f904f45b1e9a7eae8152c2ac1248d Mon Sep 17 00:00:00 2001 From: nyorain Date: Mon, 24 Sep 2018 23:17:08 +0200 Subject: Rework session handling Sessions can now be retrieved from a backend in a more general manner. Multi-backend gets back its `session` field that contains the session if one was created, removing the interfacing from multi backend with the drm backend directly. This adds the possibility to use sessions even without the drm backend. It additionally fixes the bug that 2 session objects got created when WLR_BACKENDS were set to "libinput,drm". To allow vt switching without drm backend (and drm fd) on logind, start listening to PropertiesChanged signals from dbus and parse the session "Active" property when no master fd was created (this does not change current drm backend behaviour in any way). --- rootston/keyboard.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'rootston') diff --git a/rootston/keyboard.c b/rootston/keyboard.c index b5a8093b..b28bd773 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -193,14 +192,13 @@ static bool keyboard_execute_compositor_binding(struct roots_keyboard *keyboard, if (keysym >= XKB_KEY_XF86Switch_VT_1 && keysym <= XKB_KEY_XF86Switch_VT_12) { struct roots_server *server = keyboard->input->server; - if (wlr_backend_is_multi(server->backend)) { - struct wlr_session *session = - wlr_multi_get_session(server->backend); - if (session) { - unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; - wlr_session_change_vt(session, vt); - } + + struct wlr_session *session = wlr_backend_get_session(server->backend); + if (session) { + unsigned vt = keysym - XKB_KEY_XF86Switch_VT_1 + 1; + wlr_session_change_vt(session, vt); } + return true; } -- cgit v1.2.3