From 3c2fa1625d1fc0c7399219ef1ba2af771b5d0bf6 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 28 Nov 2021 01:12:35 +0300 Subject: [PATCH 1/2] Finish --- meson.build | 5 +++++ meson_options.txt | 1 + protocol/meson.build | 5 ++++- src/factory.cpp | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 62ac8e36..52c9d292 100644 --- a/meson.build +++ b/meson.build @@ -257,6 +257,10 @@ else src_files += 'src/modules/simpleclock.cpp' endif +if get_option('experimental') + add_project_arguments('-DUSE_EXPERIMENTAL', language: 'cpp') +endif + subdir('protocol') executable( @@ -383,3 +387,4 @@ if clangtidy.found() '-p', meson.build_root() ] + src_files) endif + diff --git a/meson_options.txt b/meson_options.txt index 81e44689..f4f60d09 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,3 +11,4 @@ option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk- option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL') option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio') option('tests', type: 'feature', value: 'auto', description: 'Enable tests') +option('experimental', type : 'boolean', value : false, description: 'Enable experimental features') diff --git a/protocol/meson.build b/protocol/meson.build index 6e82d63d..8aed83df 100644 --- a/protocol/meson.build +++ b/protocol/meson.build @@ -27,11 +27,14 @@ client_protocols = [ [wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], ['wlr-layer-shell-unstable-v1.xml'], ['wlr-foreign-toplevel-management-unstable-v1.xml'], - ['ext-workspace-unstable-v1.xml'], ['river-status-unstable-v1.xml'], ['river-control-unstable-v1.xml'], ] +if get_option('experimental') + client_protocols += ['ext-workspace-unstable-v1.xml'] +endif + client_protos_src = [] client_protos_headers = [] diff --git a/src/factory.cpp b/src/factory.cpp index a577751a..351aa332 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -30,10 +30,12 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "wlr/taskbar") { return new waybar::modules::wlr::Taskbar(id, bar_, config_[name]); } +#ifdef USE_EXPERIMENTAL if (ref == "wlr/workspaces") { return new waybar::modules::wlr::WorkspaceManager(id, bar_, config_[name]); } #endif +#endif #ifdef HAVE_RIVER if (ref == "river/tags") { return new waybar::modules::river::Tags(id, bar_, config_[name]); From 2fb671f5fa1aab8fc52aa0208b586cd0824cada2 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 28 Nov 2021 01:19:21 +0300 Subject: [PATCH 2/2] Revert protocol build --- protocol/meson.build | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/protocol/meson.build b/protocol/meson.build index 8aed83df..6e82d63d 100644 --- a/protocol/meson.build +++ b/protocol/meson.build @@ -27,14 +27,11 @@ client_protocols = [ [wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], ['wlr-layer-shell-unstable-v1.xml'], ['wlr-foreign-toplevel-management-unstable-v1.xml'], + ['ext-workspace-unstable-v1.xml'], ['river-status-unstable-v1.xml'], ['river-control-unstable-v1.xml'], ] -if get_option('experimental') - client_protocols += ['ext-workspace-unstable-v1.xml'] -endif - client_protos_src = [] client_protos_headers = []