diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-12-20 22:16:13 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-20 22:16:13 +0000 |
| commit | b9bef6955487b75d13cfedd230bdc4adafedd115 (patch) | |
| tree | 21400bb6bbb37651ad8e2f3338d2fa5e317b4098 /src/debug/HyprCtl.cpp | |
| parent | 70f54a1e1ba3478a56faf82431b2770bd727431d (diff) | |
Desktop/history: Move history to desktop (#12676)
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 90adab91..41b34e8a 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -45,6 +45,7 @@ using namespace Hyprutils::OS; #include "helpers/MiscFunctions.hpp" #include "../desktop/view/LayerSurface.hpp" #include "../desktop/rule/Engine.hpp" +#include "../desktop/history/WindowHistoryTracker.hpp" #include "../desktop/state/FocusState.hpp" #include "../version.h" @@ -354,9 +355,10 @@ static std::string getGroupedData(PHLWINDOW w, eHyprCtlOutputFormat format) { std::string CHyprCtl::getWindowData(PHLWINDOW w, eHyprCtlOutputFormat format) { auto getFocusHistoryID = [](PHLWINDOW wnd) -> int { - for (size_t i = 0; i < Desktop::focusState()->windowHistory().size(); ++i) { - if (Desktop::focusState()->windowHistory()[i].lock() == wnd) - return i; + const auto& HISTORY = Desktop::History::windowTracker()->fullHistory(); + for (size_t i = 0; i < HISTORY.size(); ++i) { + if (HISTORY[i].lock() == wnd) + return HISTORY.size() - i - 1; // reverse order for backwards compat } return -1; }; |
