aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2018-09-24 23:17:08 +0200
committernyorain <nyorain@gmail.com>2018-09-24 23:35:09 +0200
commit7b523884249f904f45b1e9a7eae8152c2ac1248d (patch)
tree1f8c365bb0cf86c1f3344376b3e81e16dce5a1c7 /include/wlr
parent5b687b4a9676448148aa8da1917b849857aae78f (diff)
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).
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/backend.h5
-rw-r--r--include/wlr/backend/drm.h2
-rw-r--r--include/wlr/backend/interface.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/include/wlr/backend.h b/include/wlr/backend.h
index 39d072e2..dfb8d2a8 100644
--- a/include/wlr/backend.h
+++ b/include/wlr/backend.h
@@ -57,5 +57,10 @@ void wlr_backend_destroy(struct wlr_backend *backend);
* Obtains the wlr_renderer reference this backend is using.
*/
struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend);
+/**
+ * Obtains the wlr_session reference from this backend if there is any.
+ * Might return NULL for backends that don't use a session.
+ */
+struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend);
#endif
diff --git a/include/wlr/backend/drm.h b/include/wlr/backend/drm.h
index 5d47647d..3724adfb 100644
--- a/include/wlr/backend/drm.h
+++ b/include/wlr/backend/drm.h
@@ -34,6 +34,4 @@ bool wlr_output_is_drm(struct wlr_output *output);
typedef struct _drmModeModeInfo drmModeModeInfo;
bool wlr_drm_connector_add_mode(struct wlr_output *output, const drmModeModeInfo *mode);
-struct wlr_session *wlr_drm_backend_get_session(struct wlr_backend *backend);
-
#endif
diff --git a/include/wlr/backend/interface.h b/include/wlr/backend/interface.h
index f3dee69b..2c300709 100644
--- a/include/wlr/backend/interface.h
+++ b/include/wlr/backend/interface.h
@@ -17,6 +17,7 @@ struct wlr_backend_impl {
bool (*start)(struct wlr_backend *backend);
void (*destroy)(struct wlr_backend *backend);
struct wlr_renderer *(*get_renderer)(struct wlr_backend *backend);
+ struct wlr_session *(*get_session)(struct wlr_backend *backend);
};
/**