server: request xdg-shell v2

Wlroots does not yet support the newer xdg-shell versions and now
requires the compositor to set the supported xdg-shell version during
creation. Set this to v2 for sway as well.

Fixes https://github.com/swaywm/sway/issues/7001
This commit is contained in:
Rouven Czerwinski 2022-05-16 13:53:36 +02:00 committed by Simon Zeni
parent ffc603d451
commit 3f600565e4

View file

@ -72,6 +72,8 @@ static void handle_drm_lease_request(struct wl_listener *listener, void *data) {
} }
} }
#define SWAY_XDG_SHELL_VERSION 2
bool server_init(struct sway_server *server) { bool server_init(struct sway_server *server) {
sway_log(SWAY_DEBUG, "Initializing Wayland server"); sway_log(SWAY_DEBUG, "Initializing Wayland server");
@ -126,7 +128,8 @@ bool server_init(struct sway_server *server) {
&server->layer_shell_surface); &server->layer_shell_surface);
server->layer_shell_surface.notify = handle_layer_shell_surface; server->layer_shell_surface.notify = handle_layer_shell_surface;
server->xdg_shell = wlr_xdg_shell_create(server->wl_display); server->xdg_shell = wlr_xdg_shell_create(server->wl_display,
SWAY_XDG_SHELL_VERSION);
wl_signal_add(&server->xdg_shell->events.new_surface, wl_signal_add(&server->xdg_shell->events.new_surface,
&server->xdg_shell_surface); &server->xdg_shell_surface);
server->xdg_shell_surface.notify = handle_xdg_shell_surface; server->xdg_shell_surface.notify = handle_xdg_shell_surface;