aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/compositor/main.c2
-rw-r--r--examples/pointer.c2
-rw-r--r--examples/rotation.c2
-rw-r--r--examples/shared.c28
-rw-r--r--examples/shared.h2
-rw-r--r--examples/simple.c2
-rw-r--r--examples/tablet.c2
-rw-r--r--examples/touch.c2
8 files changed, 20 insertions, 22 deletions
diff --git a/examples/compositor/main.c b/examples/compositor/main.c
index e13fda24..c618961d 100644
--- a/examples/compositor/main.c
+++ b/examples/compositor/main.c
@@ -6,7 +6,7 @@
#include <inttypes.h>
#include <wayland-server.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/render.h>
#include <wlr/render/gles2.h>
#include <wlr/types/wlr_output.h>
diff --git a/examples/pointer.c b/examples/pointer.c
index c7518841..d159caf5 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -14,7 +14,7 @@
#include <wlr/render/gles2.h>
#include <wlr/render.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/util/log.h>
#include "shared.h"
diff --git a/examples/rotation.c b/examples/rotation.c
index 36e95f50..bcf855d9 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -14,7 +14,7 @@
#include <wlr/render/gles2.h>
#include <wlr/render.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/types/wlr_keyboard.h>
#include <math.h>
#include "shared.h"
diff --git a/examples/shared.c b/examples/shared.c
index 6d225a85..c66b8a23 100644
--- a/examples/shared.c
+++ b/examples/shared.c
@@ -8,7 +8,8 @@
#include <xkbcommon/xkbcommon.h>
#include <wayland-server-protocol.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
+#include <wlr/backend/multi.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/util/log.h>
@@ -44,8 +45,16 @@ static void keyboard_key_notify(struct wl_listener *listener, void *data) {
}
if (sym == XKB_KEY_Escape) {
wl_display_terminate(kbstate->compositor->display);
- } else if (key_state == WLR_KEY_PRESSED && sym >= XKB_KEY_F1 && sym <= XKB_KEY_F12) {
- wlr_session_change_vt(kbstate->compositor->session, sym - XKB_KEY_F1 + 1);
+ } else if (key_state == WLR_KEY_PRESSED &&
+ sym >= XKB_KEY_XF86Switch_VT_1 &&
+ sym <= XKB_KEY_XF86Switch_VT_12) {
+ if (wlr_backend_is_multi(kbstate->compositor->backend)) {
+ struct wlr_session *session =
+ wlr_multi_get_session(kbstate->compositor->backend);
+ if (session) {
+ wlr_session_change_vt(session, sym - XKB_KEY_XF86Switch_VT_1 + 1);
+ }
+ }
}
}
xkb_state_update_key(kbstate->xkb_state, keycode,
@@ -440,12 +449,6 @@ static void output_remove_notify(struct wl_listener *listener, void *data) {
void compositor_init(struct compositor_state *state) {
state->display = wl_display_create();
state->event_loop = wl_display_get_event_loop(state->display);
- state->session = wlr_session_start(state->display);
- if (!state->session
- || !state->display
- || !state->event_loop) {
- exit(1);
- }
wl_list_init(&state->keyboards);
wl_list_init(&state->pointers);
@@ -463,10 +466,8 @@ void compositor_init(struct compositor_state *state) {
wl_list_init(&state->output_remove.link);
state->output_remove.notify = output_remove_notify;
- struct wlr_backend *wlr = wlr_backend_autocreate(
- state->display, state->session);
+ struct wlr_backend *wlr = wlr_backend_autocreate(state->display);
if (!wlr) {
- wlr_session_finish(state->session);
exit(1);
}
wl_signal_add(&wlr->events.input_add, &state->input_add);
@@ -481,7 +482,6 @@ void compositor_init(struct compositor_state *state) {
if (!socket) {
wlr_log_errno(L_ERROR, "Unable to open wayland socket");
wlr_backend_destroy(wlr);
- wlr_session_finish(state->session);
exit(1);
}
@@ -490,7 +490,6 @@ void compositor_init(struct compositor_state *state) {
if (!wlr_backend_init(state->backend)) {
wlr_log(L_ERROR, "Failed to initialize backend");
wlr_backend_destroy(wlr);
- wlr_session_finish(state->session);
exit(1);
}
}
@@ -498,6 +497,5 @@ void compositor_init(struct compositor_state *state) {
void compositor_run(struct compositor_state *state) {
wl_display_run(state->display);
wlr_backend_destroy(state->backend);
- wlr_session_finish(state->session);
wl_display_destroy(state->display);
}
diff --git a/examples/shared.h b/examples/shared.h
index 1633f2c8..2379eef9 100644
--- a/examples/shared.h
+++ b/examples/shared.h
@@ -8,7 +8,7 @@
#include <xkbcommon/xkbcommon.h>
#include <wayland-server-protocol.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_input_device.h>
diff --git a/examples/simple.c b/examples/simple.c
index 45cb2b93..8e098e18 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -7,7 +7,7 @@
#include <wayland-server.h>
#include <GLES2/gl2.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/types/wlr_output.h>
#include <xkbcommon/xkbcommon.h>
#include "shared.h"
diff --git a/examples/tablet.c b/examples/tablet.c
index d7f7d042..0be6dcb9 100644
--- a/examples/tablet.c
+++ b/examples/tablet.c
@@ -13,7 +13,7 @@
#include <wlr/render/gles2.h>
#include <wlr/render.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_tablet_tool.h>
#include <wlr/types/wlr_tablet_pad.h>
diff --git a/examples/touch.c b/examples/touch.c
index 97009e81..15ad9d49 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -15,7 +15,7 @@
#include <wlr/render/gles2.h>
#include <wlr/render.h>
#include <wlr/backend.h>
-#include <wlr/session.h>
+#include <wlr/backend/session.h>
#include <wlr/util/list.h>
#include "shared.h"
#include "cat.h"