From 89b4bc4bc7e52ecdcc809b4ffe48cba93de2794e Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 25 Jan 2021 19:24:21 -0800 Subject: [PATCH] xdg-foreign: add v1 and v2 implementations Co-authored-by: Jason Francis --- sway/server.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sway/server.c b/sway/server.c index f51fcfe26..f180da9af 100644 --- a/sway/server.c +++ b/sway/server.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,11 @@ #include #include #include +#if WLR_HAS_XDG_FOREIGN +#include +#include +#include +#endif #include #include "config.h" #include "list.h" @@ -150,6 +156,13 @@ bool server_init(struct sway_server *server) { wlr_primary_selection_v1_device_manager_create(server->wl_display); wlr_viewporter_create(server->wl_display); +#if WLR_HAS_XDG_FOREIGN + struct wlr_xdg_foreign_registry *foreign_registry = + wlr_xdg_foreign_registry_create(server->wl_display); + wlr_xdg_foreign_v1_create(server->wl_display, foreign_registry); + wlr_xdg_foreign_v2_create(server->wl_display, foreign_registry); +#endif + // Avoid using "wayland-0" as display socket char name_candidate[16]; for (int i = 1; i <= 32; ++i) {