mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1319] [MERGED] refactor: alt-tab rework #1322
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/1319
Author: @alex-ds13
Created: 3/4/2025
Status: ✅ Merged
Merged: 4/1/2025
Merged by: @LGUG2Z
Base:
master← Head:feat/alt-tab-rework📝 Commits (2)
db5d1e1refactor(wm): refactor alt-tab reconciliatione3333d0remove(wm): remove workspace_reconciliator📊 Changes
6 files changed (+139 additions, -171 deletions)
View changed files
📝
komorebi/src/border_manager/mod.rs(+0 -3)📝
komorebi/src/lib.rs(+0 -1)📝
komorebi/src/main.rs(+0 -2)📝
komorebi/src/process_event.rs(+135 -34)📝
komorebi/src/workspace.rs(+4 -1)➖
komorebi/src/workspace_reconciliator.rs(+0 -130)📄 Description
This is a refactor of the
alt-tabreconciliation. This PR gets rid of theworkspace_reconciliator, hence removing another source of potential issues with WM locks.To replace it there are two simple new functions:
needs_reconciliation(): checks if the window with theShoworUncloakevent is already handled by komorebi and if it is, checks if it is a window on an unfocused workspace or a hidden window on a stack container. If this is the case then it means the user alt-tabbed into some window and we need to reconcile the currently focused monitor, workspace, container and window on komorebi to the ones from the window the user just alt-tabbed into. This function returns the monitor/workspace index pair of the window in question.perform_reconciliation(): this function actually performs the previously mentioned reconciliation. If the window was on a stack it makes sure to update the focused window of that stack even if that stack is on the currently focused workspace. If there was a monocle on the workspace of that window, then it toggles the monocle off so that we can give focus to the alt-tabbed window.This also fixes 2 bugs related to the alt-tab:
I'm making this a draft since it is a big change and I'm not sure exactly of the reasons that lead you to make the
workspace_reconciliatorin the first place. I'm not sure if there was a specific reason to need to have the reconciliation being done on another thread with a 100ms delay with all that that entails. From my tests, this version of mine works just fine like it used to with the added benefit of the aforementioned bug fixes. I haven't encountered any issues withalt-tabyet. There was also some situations before where komorebi would think some event was an alt-tab when in fact it wasn't and it would send a notification and perform a workspace reconciliation. That also doesn't seem to be happening anymore.In spite of my tests revealing no issues so far, I still think this should be kept as a draft for a while until at least a couple more people can test it out!
So I'm calling out for @LGUG2Z, @CtByte and any others that can help test this!
Also I've seen this discussion #1275 which is what first prompted to look into the
alt-tabto fix the mentioned issue, so I would also like to ping @f34r1335 in case you are able to test this PR as well and see if it works well for you!🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.