mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-09-15 06:11:50 +02:00
feat(wm): add workspace reconciliator module
This commit adds the workspace_reconciliator module which uses a tightly bounded channel (cap: 1) to update the focused workspace in situations where the user or another process has foregrounded a window that is on a different workspace. This most often happens via Alt-Tab, or by clicking a link which opens in another application. workspace_reconciliator::Notification contains the target monitor and workspace indices, which when received allows for the correct workspace to be focused. These notifications are sent in process_event.rs when handling WindowManagerEvent::Show, Manage and Uncloak events. All previous logic pertaining to workspace reconciliation which lived in the handler for these events has been removed and replaced with notifications sent to the reconciliator. As the notifications channel is tightly capped and any notifications which overflow the cap will never be delivered, we are able to avoid the infinite workspace switching loops which happened when using the previous logic, which ran on every single event.
This commit is contained in:
@@ -21,6 +21,7 @@ pub mod windows_callbacks;
|
||||
pub mod winevent;
|
||||
pub mod winevent_listener;
|
||||
pub mod workspace;
|
||||
pub mod workspace_reconciliator;
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use std::collections::HashMap;
|
||||
|
||||
Reference in New Issue
Block a user