From 413d2104224d609c3f08be538d0e27d3295230ba Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 16 Feb 2021 13:34:46 +0100 Subject: [PATCH] libweston-desktop: introduce a deprecated-wl-shell option This is the first step towards removing wl_shell support. Add an option so that users can toggle support for the deprecated wl_shell protocol. This lets users test their clients to make sure they work fine without wl_shell. The option is set to false by default. Signed-off-by: Simon Ser --- libweston-desktop/libweston-desktop.c | 9 +++++++++ meson.build | 4 ++++ meson_options.txt | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/libweston-desktop/libweston-desktop.c b/libweston-desktop/libweston-desktop.c index 2b42ac7e..fdfe21bf 100644 --- a/libweston-desktop/libweston-desktop.c +++ b/libweston-desktop/libweston-desktop.c @@ -77,12 +77,21 @@ weston_desktop_create(struct weston_compositor *compositor, return NULL; } +#ifdef HAVE_DEPRECATED_WL_SHELL + weston_log("Warning: support for deprecated wl_shell interface is " + "enabled. Please migrate legacy clients to xdg-shell.\n"); desktop->wl_shell = weston_desktop_wl_shell_create(desktop, display); if (desktop->wl_shell == NULL) { weston_desktop_destroy(desktop); return NULL; } +#else + weston_log("Note: support for the deprecated wl_shell interface is " + "disabled. If a legacy client still needs it, it can be " + "re-enabled by passing -Ddeprecated-wl-shell=true to Meson " + "when building Weston.\n"); +#endif weston_desktop_xwayland_init(desktop); diff --git a/meson.build b/meson.build index f818ab19..78a4df93 100644 --- a/meson.build +++ b/meson.build @@ -139,6 +139,10 @@ if dep_xkbcommon.version().version_compare('>= 0.5.0') config_h.set('HAVE_XKBCOMMON_COMPOSE', '1') endif +if get_option('deprecated-wl-shell') + config_h.set('HAVE_DEPRECATED_WL_SHELL', '1') +endif + dep_wayland_server = dependency('wayland-server', version: '>= 1.18.0') dep_wayland_client = dependency('wayland-client', version: '>= 1.18.0') dep_pixman = dependency('pixman-1', version: '>= 0.25.2') diff --git a/meson_options.txt b/meson_options.txt index c7aa9ec0..d404aef7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -138,6 +138,13 @@ option( description: 'Weston desktop shell: default helper client selection' ) +option( + 'deprecated-wl-shell', + type: 'boolean', + value: false, + description: 'Enable the deprecated wl_shell protocol' +) + option( 'color-management-lcms', type: 'boolean',