This commit is contained in:
Vaxry 2025-12-18 17:22:12 +00:00
parent e3fc75e91b
commit 2cb792f9b1
Signed by: vaxry
GPG key ID: 665806380871D640
2 changed files with 9 additions and 2 deletions

View file

@ -1455,7 +1455,7 @@ PHLWINDOW CCompositor::getWindowInDirection(const CBox& box, PHLWORKSPACE pWorks
// get idx
int windowIDX = -1;
const auto& HISTORY = Desktop::History::windowTracker()->fullHistory();
for (int64_t i = HISTORY.size() - 1; i > 0; --i) {
for (int64_t i = HISTORY.size() - 1; i >= 0; --i) {
if (HISTORY[i] == w) {
windowIDX = i;
break;

View file

@ -12,7 +12,14 @@ SP<CWindowHistoryTracker> History::windowTracker() {
}
CWindowHistoryTracker::CWindowHistoryTracker() {
static auto P = g_pHookSystem->hookDynamic("activeWindow", [this](void* self, SCallbackInfo& info, std::any data) {
static auto P = g_pHookSystem->hookDynamic("openWindowEarly", [this](void* self, SCallbackInfo& info, std::any data) {
auto window = std::any_cast<PHLWINDOW>(data);
// add a last track
m_history.insert(m_history.begin(), window);
});
static auto P1 = g_pHookSystem->hookDynamic("activeWindow", [this](void* self, SCallbackInfo& info, std::any data) {
auto window = std::any_cast<PHLWINDOW>(data);
track(window);