Merge pull request #4134 from Roc25/hide-active

Add hide-active
This commit is contained in:
Alexis Rouillard
2026-07-03 22:47:15 +02:00
committed by GitHub
4 changed files with 17 additions and 0 deletions
+2
View File
@@ -39,6 +39,7 @@ class Workspaces : public AModule, public EventHandler {
auto allOutputs() const -> bool { return m_allOutputs; }
auto showSpecial() const -> bool { return m_showSpecial; }
auto activeOnly() const -> bool { return m_activeOnly; }
auto hideActive() const -> bool { return m_hideActive; }
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
auto persistentOnly() const -> bool { return m_persistentOnly; }
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
@@ -146,6 +147,7 @@ class Workspaces : public AModule, public EventHandler {
bool m_allOutputs = false;
bool m_showSpecial = false;
bool m_activeOnly = false;
bool m_hideActive = false;
bool m_specialVisibleOnly = false;
bool m_persistentOnly = false;
bool m_moveToMonitor = false;
+5
View File
@@ -123,6 +123,11 @@ This setting is ignored if *workspace-taskbar.enable* is set to true.
default: false ++
If set to true, only the active workspace will be shown.
*hide-active*: ++
typeof: bool ++
default: false ++
If set to true, the active workspace will be hidden. Unless a workspace is persistent or special.
*move-to-monitor*: ++
typeof: bool ++
default: false ++
+9
View File
@@ -341,6 +341,15 @@ void Workspace::update(const std::string& workspace_icon) {
return;
}
// clang-format off
if (this->m_workspaceManager.hideActive() && \
this->isActive() && \
!this->isPersistent() && \
!this->isSpecial()) {
// clang-format on
m_button.hide();
return;
}
// clang-format off
if (this->m_workspaceManager.activeOnly() && \
!this->isActive() && \
!this->isPersistent() && \
+1
View File
@@ -662,6 +662,7 @@ auto Workspaces::parseConfig(const Json::Value& config) -> void {
populateBoolConfig(config, "special-visible-only", m_specialVisibleOnly);
populateBoolConfig(config, "persistent-only", m_persistentOnly);
populateBoolConfig(config, "active-only", m_activeOnly);
populateBoolConfig(config, "hide-active", m_hideActive);
populateBoolConfig(config, "move-to-monitor", m_moveToMonitor);
populateBoolConfig(config, "enable-bar-scroll", m_barScroll);