Skip to content

Commit

Permalink
hyprctl: fix crash in unsafe state with activeworkspace
Browse files Browse the repository at this point in the history
fixes #3419
  • Loading branch information
vaxerski committed Sep 25, 2023
1 parent 3b65725 commit ffacd2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/debug/HyprCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,15 @@ static std::string getWorkspaceData(CWorkspace* w, HyprCtl::eHyprCtlOutputFormat
}

std::string activeWorkspaceRequest(HyprCtl::eHyprCtlOutputFormat format) {
if (!g_pCompositor->m_pLastMonitor)
return "unsafe state";

std::string result = "";
auto w = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);

if (!w)
return "internal error";

return getWorkspaceData(w, format);
}

Expand Down

0 comments on commit ffacd2e

Please sign in to comment.