diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-08 17:47:12 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-08 17:47:12 +0000 |
| commit | 717d5b3cc2b9e2f94d3ec1ba794e21bc2bb787e3 (patch) | |
| tree | 975b7dd0936a227276ff1a7e6af882f2878b19b6 /src/debug/HyprCtl.cpp | |
| parent | 0a4ade01d35abb4506da77cc64ab93e0c5c34dbd (diff) | |
hyprctl: hide unmapped windows without -a
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 594d002f..80b1d16c 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -242,6 +242,9 @@ std::string clientsRequest(eHyprCtlOutputFormat format, std::string request) { result += "["; for (auto& w : g_pCompositor->m_vWindows) { + if (!w->m_bIsMapped && !g_pHyprCtl->m_sCurrentRequestParams.all) + continue; + result += getWindowData(w.get(), format); } @@ -250,6 +253,9 @@ std::string clientsRequest(eHyprCtlOutputFormat format, std::string request) { result += "]"; } else { for (auto& w : g_pCompositor->m_vWindows) { + if (!w->m_bIsMapped && !g_pHyprCtl->m_sCurrentRequestParams.all) + continue; + result += getWindowData(w.get(), format); } } @@ -1562,8 +1568,9 @@ void CHyprCtl::unregisterCommand(const std::shared_ptr<SHyprCtlCommand>& cmd) { } std::string CHyprCtl::getReply(std::string request) { - auto format = eHyprCtlOutputFormat::FORMAT_NORMAL; - bool reloadAll = false; + auto format = eHyprCtlOutputFormat::FORMAT_NORMAL; + bool reloadAll = false; + m_sCurrentRequestParams = {}; // process flags for non-batch requests if (!request.starts_with("[[BATCH]]") && request.contains("/")) { @@ -1584,8 +1591,10 @@ std::string CHyprCtl::getReply(std::string request) { if (c == 'j') format = eHyprCtlOutputFormat::FORMAT_JSON; - if (c == 'r') + else if (c == 'r') reloadAll = true; + else if (c == 'a') + m_sCurrentRequestParams.all = true; } if (sepIndex < request.size()) |
