build: target wlroots 0.20, pin fallback to 0.20.2

Rename the text_input/input_method manager events and declare the
host-side cursor-shape interfaces wlroots 0.20 no longer exports
via its headers.
This commit is contained in:
Andrew Hamilton 2026-09-07 23:37:45 +10:00
parent 1f35f90a95
commit 0dc782a5d3
5 changed files with 35 additions and 23 deletions

20
kick.c
View file

@ -1,4 +1,4 @@
/* kick.c -- nested kick compositor built on wlroots 0.19.
/* kick.c -- nested kick compositor built on wlroots 0.20.
*
* Renders a headless wlroots output (via wlr_scene) inside a host Wayland
* window (the "host" connection, e.g. labwc). Input from the host is
@ -141,6 +141,16 @@
#include <wlr/xwayland/xwayland.h>
#endif
/* Host-side cursor-shape-v1 interface descriptors, used for the manual
wl_proxy_marshal_flags() forwarding below. wlroots 0.19 exposed these via
its wlr_cursor_shape_v1.h (which included the generated server header);
0.20 only includes the enum header, so declare them here instead. The
definitions come from kick's own generated cursor-shape protocol code
(not from libwlroots), which is why the generated client header must NOT
be included here too -- it would redefine the shape enum. */
extern const struct wl_interface wp_cursor_shape_manager_v1_interface;
extern const struct wl_interface wp_cursor_shape_device_v1_interface;
/* server.tabs is a plain list of tabs; there is no tab limit. */
/* ===================== Server-side (wlroots) state ===================== */
@ -7303,8 +7313,8 @@ static void host_cursor_shape_get_pointer(void) {
return;
}
/* get_pointer = the sole new_id request (opcode 1); the interface symbol
comes from libwlr (we must not also include the generated client header
here: both server and client headers define the shape enum). */
is declared above (defined by our generated cursor-shape protocol
code, not by libwlr). */
host.shape_dev = (struct wp_cursor_shape_device_v1 *)wl_proxy_marshal_flags(
(struct wl_proxy *)host.shape_mgr, 1 /* WP_CURSOR_SHAPE_MANAGER_V1_GET_POINTER */,
&wp_cursor_shape_device_v1_interface,
@ -11497,10 +11507,10 @@ int main(int argc, char *argv[]) {
server.input_method_mgr =
wlr_input_method_manager_v2_create(server.wl_display);
server.text_input_new.notify = handle_text_input_new;
wl_signal_add(&server.text_input_mgr->events.text_input,
wl_signal_add(&server.text_input_mgr->events.new_text_input,
&server.text_input_new);
server.input_method_new.notify = handle_input_method_new;
wl_signal_add(&server.input_method_mgr->events.input_method,
wl_signal_add(&server.input_method_mgr->events.new_input_method,
&server.input_method_new);
server.seat_keyboard_focus.notify = handle_seat_keyboard_focus;
wl_signal_add(&server.seat->keyboard_state.events.focus_change,