aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/libinput/keyboard.c2
-rw-r--r--backend/wayland/backend.c30
-rw-r--r--backend/wayland/output.c2
-rw-r--r--backend/wayland/wl_seat.c6
4 files changed, 20 insertions, 20 deletions
diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c
index 1c52a6b8..2a626148 100644
--- a/backend/libinput/keyboard.c
+++ b/backend/libinput/keyboard.c
@@ -68,5 +68,5 @@ void handle_keyboard_key(struct libinput_event *event,
wlr_event.state = WLR_KEY_PRESSED;
break;
}
- wl_signal_emit(&wlr_dev->keyboard->events.key, &wlr_event);
+ wlr_keyboard_update_state(wlr_dev->keyboard, &wlr_event);
}
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index d917c7e9..264ce338 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -35,26 +35,13 @@ static bool wlr_wl_backend_start(struct wlr_backend *_backend) {
struct wlr_wl_backend *backend = (struct wlr_wl_backend *)_backend;
wlr_log(L_INFO, "Initializating wayland backend");
- backend->remote_display = wl_display_connect(NULL);
- if (!backend->remote_display) {
- wlr_log_errno(L_ERROR, "Could not connect to remote display");
- return false;
- }
-
- if (!(backend->registry = wl_display_get_registry(backend->remote_display))) {
- wlr_log_errno(L_ERROR, "Could not obtain reference to remote registry");
- return false;
- }
-
wlr_wl_registry_poll(backend);
if (!(backend->compositor) || (!(backend->shell))) {
wlr_log_errno(L_ERROR, "Could not obtain retrieve required globals");
return false;
}
- wlr_egl_init(&backend->egl, EGL_PLATFORM_WAYLAND_EXT, backend->remote_display);
- wlr_egl_bind_display(&backend->egl, backend->local_display);
-
+ backend->started = true;
for (size_t i = 0; i < backend->requested_outputs; ++i) {
wlr_wl_output_create(&backend->backend);
}
@@ -146,6 +133,21 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display) {
}
backend->local_display = display;
+
+ backend->remote_display = wl_display_connect(NULL);
+ if (!backend->remote_display) {
+ wlr_log_errno(L_ERROR, "Could not connect to remote display");
+ return false;
+ }
+
+ if (!(backend->registry = wl_display_get_registry(backend->remote_display))) {
+ wlr_log_errno(L_ERROR, "Could not obtain reference to remote registry");
+ return false;
+ }
+
+ wlr_egl_init(&backend->egl, EGL_PLATFORM_WAYLAND_EXT, backend->remote_display);
+ wlr_egl_bind_display(&backend->egl, backend->local_display);
+
return &backend->backend;
error:
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 3e673bcc..ba04aede 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -209,7 +209,7 @@ static struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) {
assert(wlr_backend_is_wl(_backend));
struct wlr_wl_backend *backend = (struct wlr_wl_backend *)_backend;
- if (!backend->remote_display) {
+ if (!backend->started) {
++backend->requested_outputs;
return NULL;
}
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 3e6982a0..ba3feb8d 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -128,17 +128,15 @@ static const struct wl_pointer_listener pointer_listener = {
static void keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard,
uint32_t format, int32_t fd, uint32_t size) {
-
+ // TODO: set keymap
}
static void keyboard_handle_enter(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface, struct wl_array *keys) {
-
}
static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface) {
-
}
static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard,
@@ -151,7 +149,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard,
wlr_event.state = state;
wlr_event.time_sec = time / 1000;
wlr_event.time_usec = time * 1000;
- wl_signal_emit(&dev->keyboard->events.key, &wlr_event);
+ wlr_keyboard_update_state(dev->keyboard, &wlr_event);
}
static void keyboard_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard,