summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2022-08-06 21:56:16 +0200
committerGitHub <noreply@github.com>2022-08-06 21:56:16 +0200
commit3829b1626e2aea5eb479d29f3014f50b1961a1f7 (patch)
tree9d59d9adc43eba42adaa8f2650bddcf8b712a8f6 /src/debug/HyprCtl.cpp
parent793b23dbe6a2ad1396a0dcbd9191223ad844f916 (diff)
parent5ce7c71cef76155c9b286aeff2403f83e356dfce (diff)
Merge pull request #483 from rubyist/json-when-no-activewindow
Have hyprctl -j activewindows return empty json object if there are no activewindows
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 5e28b96e..c0d0463b 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -157,7 +157,7 @@ std::string activeWindowRequest(HyprCtl::eHyprCtlOutputFormat format) {
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!g_pCompositor->windowValidMapped(PWINDOW))
- return "Invalid";
+ return format == HyprCtl::FORMAT_JSON ? "{}" : "Invalid";
if (format == HyprCtl::FORMAT_JSON) {
return getFormat(