diff --git a/examples/miral-shell/shell_main.cpp b/examples/miral-shell/shell_main.cpp index 1bccf852c00..84ebc4ae718 100644 --- a/examples/miral-shell/shell_main.cpp +++ b/examples/miral-shell/shell_main.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,30 @@ #include +#include + +namespace +{ +struct ConfigureDecorations +{ + miral::Decorations const decorations{[] + { + if (auto const strategy = getenv("MIRAL_SHELL_DECORATIONS")) + { + if (strcmp(strategy, "always-ssd") == 0) return miral::Decorations::always_ssd(); + if (strcmp(strategy, "prefer-ssd") == 0) return miral::Decorations::prefer_ssd(); + if (strcmp(strategy, "always-csd") == 0) return miral::Decorations::always_csd(); + } + return miral::Decorations::prefer_csd(); + }()}; + + void operator()(mir::Server& s) const + { + decorations(s); + } +}; +} + int main(int argc, char const* argv[]) { using namespace miral; @@ -113,6 +138,7 @@ int main(int argc, char const* argv[]) CursorTheme{"default:DMZ-White"}, WaylandExtensions{}, X11Support{}, + ConfigureDecorations{}, window_managers, display_configuration_options, external_client_launcher, diff --git a/src/server/frontend_wayland/wayland_default_configuration.cpp b/src/server/frontend_wayland/wayland_default_configuration.cpp index 8d4b9c28304..0e0dd5f923b 100644 --- a/src/server/frontend_wayland/wayland_default_configuration.cpp +++ b/src/server/frontend_wayland/wayland_default_configuration.cpp @@ -319,7 +319,8 @@ auto mf::get_standard_extensions() -> std::vector mw::TextInputManagerV1::interface_name, mw::TextInputManagerV2::interface_name, mw::TextInputManagerV3::interface_name, - mw::MirShellV1::interface_name}; + mw::MirShellV1::interface_name, + mw::XdgDecorationManagerV1::interface_name}; } auto mf::get_supported_extensions() -> std::vector