summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <[email protected]>2022-05-11 13:57:51 +0200
committerIsaac Freund <[email protected]>2022-05-15 15:44:40 +0000
commita755670648459d6c341a75a384942c3f44c5c85b (patch)
tree4f290d88fc820f72974f60b0734de1fe99ab3b64
parentf64991b5a125aa8ae51eab1de7e56e45d3b94dd9 (diff)
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
-rw-r--r--tinywl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tinywl.c b/tinywl.c
index 633b3f2..783cc18 100644
--- a/tinywl.c
+++ b/tinywl.c
@@ -853,13 +853,14 @@ int main(int argc, char *argv[]) {
server.scene = wlr_scene_create();
wlr_scene_attach_output_layout(server.scene, server.output_layout);
- /* Set up the xdg-shell. The xdg-shell is a Wayland protocol which is used
- * for application windows. For more detail on shells, refer to my article:
+ /* Set up xdg-shell version 2. The xdg-shell is a Wayland protocol which is
+ * used for application windows. For more detail on shells, refer to my
+ * article:
*
* https://drewdevault.com/2018/07/29/Wayland-shells.html
*/
wl_list_init(&server.views);
- server.xdg_shell = wlr_xdg_shell_create(server.wl_display);
+ server.xdg_shell = wlr_xdg_shell_create(server.wl_display, 2);
server.new_xdg_surface.notify = server_new_xdg_surface;
wl_signal_add(&server.xdg_shell->events.new_surface,
&server.new_xdg_surface);