From 8fe3aa29da56be16faa73aca947647bd60cd4a94 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 11 May 2022 13:57:51 +0200 Subject: xdg-shell: specify version in wlr_xdg_shell_create With protocol additions such as [1], compositors currently have no way to opt out of the version upgrade. The protocol upgrade will always be backwards-compatible but may require new compositor features. The status quo doesn't make it possible to ship a protocol addition without breaking the wlroots API. This will be an issue for API stabilization [2]. To address this, let compositors provide a maximum version in the function creating the global. We need to support all previous versions of the interface anyways because of older clients. This mechanism works the same way as Wayland clients passing a version in wl_global.bind. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3514 [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008 References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3397 --- include/wlr/types/wlr_xdg_shell.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 95c6ee6c..e6168317 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -17,6 +17,7 @@ struct wlr_xdg_shell { struct wl_global *global; + uint32_t version; struct wl_list clients; struct wl_list popup_grabs; uint32_t ping_timeout; @@ -263,7 +264,11 @@ struct wlr_xdg_toplevel_show_window_menu_event { uint32_t x, y; }; -struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display); +/** + * Create the xdg_wm_base global with the specified version. + */ +struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display, + uint32_t version); /** Get the corresponding wlr_xdg_surface from a resource. * -- cgit v1.2.3