mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1287] [MERGED] feat(reaper): rework reaper logic to make it faster #1300
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1287
Author: @alex-ds13
Created: 2/22/2025
Status: ✅ Merged
Merged: 2/22/2025
Merged by: @LGUG2Z
Base:
master← Head:feature/reaper-rework📝 Commits (1)
ff6ceaffeat(reaper): rework reaper logic to make it faster📊 Changes
7 files changed (+283 additions, -119 deletions)
View changed files
📝
komorebi/src/main.rs(+1 -1)📝
komorebi/src/monitor_reconciliator/mod.rs(+6 -5)📝
komorebi/src/process_command.rs(+3 -0)📝
komorebi/src/process_event.rs(+32 -73)📝
komorebi/src/reaper.rs(+174 -37)📝
komorebi/src/static_config.rs(+1 -1)📝
komorebi/src/window_manager.rs(+66 -2)📄 Description
This PR changes the way the reaper works.
First it changed the
known_hwndsheld by theWindowManagerto be a HashMap of window handles (isize) to a pair of monitor_idx, workspace_idx (usize, usize).Then it changes the reaper to have a cache of hwnds which is updated by the
WindowManagerwhen they change. The reaper has a thread that is continuously checking this cache to see if there is any window handle that no longer exists. When it finds them, the thread sends a notification to a channel which is then received by the reaper on another thread that actually does the work on theWindowManagerby removing said windows.This means that the reaper no longer tries to access and lock the
WindowManagerevery second like it used to, but instead it only does it when it actually needs, when a window actually needs to be reaped. This means that we can make the thread that checks for orphan windows run much more frequently since it won't influence the rest of komorebi.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.