aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput
diff options
context:
space:
mode:
authorScott Anderson <ascent12@hotmail.com>2017-06-21 13:31:29 +1200
committerScott Anderson <ascent12@hotmail.com>2017-06-21 13:31:29 +1200
commit55854565dc80352e8aca122a76da21152e428995 (patch)
tree59832c9eb8e05545de00df590960a129fc171b86 /backend/libinput
parent091de12bf4b91c9326c84a11ce10d51ca41fee0b (diff)
Fixed VT switching
Diffstat (limited to 'backend/libinput')
-rw-r--r--backend/libinput/backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index 82ba44a6..fedab148 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -86,6 +86,21 @@ static struct wlr_backend_impl backend_impl = {
.destroy = wlr_libinput_backend_destroy
};
+static void session_signal(struct wl_listener *listener, void *data) {
+ struct wlr_backend_state *backend = wl_container_of(listener, backend, session_signal);
+ struct wlr_session *session = data;
+
+ if (!backend->libinput) {
+ return;
+ }
+
+ if (session->active) {
+ libinput_resume(backend->libinput);
+ } else {
+ libinput_suspend(backend->libinput);
+ }
+}
+
struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display,
struct wlr_session *session, struct wlr_udev *udev) {
assert(display && session && udev);
@@ -112,6 +127,9 @@ struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display,
state->udev = udev;
state->display = display;
+ state->session_signal.notify = session_signal;
+ wl_signal_add(&session->session_signal, &state->session_signal);
+
return backend;
error_state:
free(state);