You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(reaper): rework reaper logic to make it faster
# This is a combination of 4 commits.
# This is the 1st commit message:
This commit changes the way the reaper works.
First this commit changed the `known_hwnds` held by the `WindowManager`
to be a HashMap of window handles (isize) to a pair of monitor_idx,
workspace_idx (usize, usize).
This commit then changes the reaper to have a cache of hwnds which is
updated by the `WindowManager` when 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 the `WindowManager` by
removing said windows.
This means that the reaper no longer tries to access and lock the
`WindowManager` every 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 is the commit message LGUG2Z#2:
refactor(wm): move update of known_hwnds to a function
# This is the commit message LGUG2Z#3:
feat(wm): update known_hwnds on process_command
# This is the commit message LGUG2Z#4:
refactor(wm): simplify loops on monitor/workspaces
This commit uses the new `known_hwnds` hashmap to simplify looking for
windows on all the monitors and all the workspaces. Since now the
`known_hwnds` have the monitor/workspace index pair of the window we can
simply get that info from the map and immediately access that
monitor/workspace or use that index info. This commit already does this
on some situations from the `process_event`.
0 commit comments