diff options
Diffstat (limited to 'wayland')
-rw-r--r-- | wayland/client.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wayland/client.c b/wayland/client.c index 4d4a6bbb..116538cf 100644 --- a/wayland/client.c +++ b/wayland/client.c | |||
@@ -74,6 +74,17 @@ static const struct wl_registry_listener registry_listener = { | |||
74 | .global_remove = registry_global_remove | 74 | .global_remove = registry_global_remove |
75 | }; | 75 | }; |
76 | 76 | ||
77 | void shell_surface_configure(void *data, struct wl_shell_surface *wl_shell_surface, | ||
78 | uint32_t edges, int32_t width, int32_t height) { | ||
79 | struct client_state *state = data; | ||
80 | state->width = width; | ||
81 | state->height = height; | ||
82 | } | ||
83 | |||
84 | static const struct wl_shell_surface_listener surface_listener = { | ||
85 | .configure = shell_surface_configure | ||
86 | }; | ||
87 | |||
77 | struct client_state *client_setup(uint32_t width, uint32_t height) { | 88 | struct client_state *client_setup(uint32_t width, uint32_t height) { |
78 | struct client_state *state = malloc(sizeof(struct client_state)); | 89 | struct client_state *state = malloc(sizeof(struct client_state)); |
79 | memset(state, 0, sizeof(struct client_state)); | 90 | memset(state, 0, sizeof(struct client_state)); |
@@ -96,6 +107,7 @@ struct client_state *client_setup(uint32_t width, uint32_t height) { | |||
96 | 107 | ||
97 | state->surface = wl_compositor_create_surface(state->compositor); | 108 | state->surface = wl_compositor_create_surface(state->compositor); |
98 | state->shell_surface = wl_shell_get_shell_surface(state->shell, state->surface); | 109 | state->shell_surface = wl_shell_get_shell_surface(state->shell, state->surface); |
110 | wl_shell_surface_add_listener(state->shell_surface, &surface_listener, state); | ||
99 | wl_shell_surface_set_toplevel(state->shell_surface); | 111 | wl_shell_surface_set_toplevel(state->shell_surface); |
100 | 112 | ||
101 | return state; | 113 | return state; |