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 <contact@emersion.fr>
This commit is contained in:
Simon Ser 2021-02-16 13:34:46 +01:00 committed by Daniel Stone
parent 80e9482292
commit 413d210422
3 changed files with 20 additions and 0 deletions

View file

@ -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);

View file

@ -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')

View file

@ -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',