diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-10-11 02:30:18 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-10-11 02:30:18 -0400 |
| commit | f43ec9b27ebe37b799709985f5587e29ec8ef88b (patch) | |
| tree | cfae61b2e1ffc3658bdf67450666f5f0c89b2b92 /registry.c | |
| parent | ba3a68a4f73f6653b1e1b095abc08234dedc504d (diff) | |
refactor to .h files
Diffstat (limited to 'registry.c')
| -rw-r--r-- | registry.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -2,9 +2,15 @@ #include <string.h> #include "./state.h" +#include "wayland.h" -extern struct wl_seat_listener seat_listener; +struct wl_registry_listener registry_listener; +void setup_registry(client_state* state) { + state->registry = wl_display_get_registry(state->display); + wl_registry_add_listener(state->registry, ®istry_listener, state); + wl_display_roundtrip(state->display); +} void global(void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version) { client_state* state = data; @@ -14,8 +20,7 @@ void global(void *data, struct wl_registry *wl_registry, uint32_t name, const ch state->compositor = wl_registry_bind(wl_registry, name, &wl_compositor_interface, 1); } else if (!strcmp(interface, wl_seat_interface.name)) { - state->seat = wl_registry_bind(wl_registry, name, &wl_seat_interface, 1); - wl_seat_add_listener(state->seat, &seat_listener, state); + setup_seat(state, name); } else if (!strcmp(interface, zwlr_layer_shell_v1_interface.name)) { state->layer_shell = wl_registry_bind(wl_registry, name, &zwlr_layer_shell_v1_interface, version); |
