From b9bef6955487b75d13cfedd230bdc4adafedd115 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 20 Dec 2025 22:16:13 +0000 Subject: Desktop/history: Move history to desktop (#12676) --- src/debug/HyprCtl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/debug/HyprCtl.cpp') 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; }; -- cgit v1.2.3