diff options
author | Ryan Walklin <ryan@testtoast.com> | 2020-06-25 22:56:56 +1200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-08-07 19:15:25 +0200 |
commit | f0d03fb8921b79c776d0fe9abedced78302c3c06 (patch) | |
tree | c5f999b9d6c6b8c2a08a2266f89965cad395997b /backend | |
parent | 30226eb1fbf2da0f1d6ff6e0c230541e95dfb46b (diff) |
Implement logind session SetType method to change session type to wayland
Diffstat (limited to 'backend')
-rw-r--r-- | backend/session/logind.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/session/logind.c b/backend/session/logind.c index 00babcae..317b179f 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -241,6 +241,24 @@ static bool take_control(struct logind_session *session) { return ret >= 0; } +static bool set_type(struct logind_session *session) { + int ret; + sd_bus_message *msg = NULL; + sd_bus_error error = SD_BUS_ERROR_NULL; + + ret = sd_bus_call_method(session->bus, "org.freedesktop.login1", + session->path, "org.freedesktop.login1.Session", "SetType", + &error, &msg, "s", "wayland"); + if (ret < 0) { + wlr_log(WLR_ERROR, "Failed to set session type for session: %s", + error.message); + } + + sd_bus_error_free(&error); + sd_bus_message_unref(msg); + return ret >= 0; +} + static void release_control(struct logind_session *session) { int ret; sd_bus_message *msg = NULL; @@ -819,6 +837,11 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) { } } + if (!set_type(session)) { + // Not fatal + wlr_log(WLR_INFO, "Failed to set logind session type to wayland"); + } + wlr_log(WLR_INFO, "Successfully loaded logind session"); session->base.impl = &session_logind; |