mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1241] [CLOSED] Fix monitor preferences #1269
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/1241
Author: @alex-ds13
Created: 1/23/2025
Status: ❌ Closed
Base:
master← Head:fix/monitor-preferences📝 Commits (10+)
281b66cfix(wm): properly store tile state when caching ws163b9a1fix(wm): store config on workspaceb1ec872fix(wm): correctly use the display_index_preferences3f70d38fix(wm): cache monitor configs for unloaded monitorsecb7f80fix(wm): don't store empty layout_rules on monitor cache71c382cfix(wm): restore orphaned containers2f04074fix(wm): skip workspace_config on workspace serdeb89228afix(wm): use serial numbers along device idscc0bbfdfix(wm): handle serial id onload_monitor_informationf91a34cfix(wm): remove workspace_rules from disconnected monitors📊 Changes
8 files changed (+377 additions, -76 deletions)
View changed files
📝
komorebi-bar/src/bar.rs(+49 -1)📝
komorebi-bar/src/komorebi.rs(+10 -0)📝
komorebi-bar/src/main.rs(+5 -1)📝
komorebi/src/monitor_reconciliator/mod.rs(+58 -20)📝
komorebi/src/static_config.rs(+203 -51)📝
komorebi/src/window_manager.rs(+5 -1)📝
komorebi/src/windows_api.rs(+41 -2)📝
komorebi/src/workspace.rs(+6 -0)📄 Description
This PR reworks the way the
postloadand thereloadfunctions apply the monitor configs to the monitors. Previously it was looping through the monitor configs and applying them to the monitor with the index corresponding to the config's index.However this isn't correct, since the user might set the preferred indices for 3 monitors (like monitor A, B and C), with the preferred index set to 0 for A, 1 for B and 2 for C, but if only monitors A and C are connected then komorebi would apply config 0 to A and config 1 to C, which is wrong it should be 2 for C.
This PR changes the way the configs are applied on those functions.
Now it loops through the existing monitors (already in order), then checks if the monitor has a preferred config index, if it does it uses that one, if it doesn't then it uses the first monitor config that isn't a preferred index for some other monitor and that hasn't been used yet.
For the situation above it means that it would still apply config 2 to monitor C. And in case there aren't any display_index_preferences set it will still apply the configs in order.
It also changes the way the layout is stored from the current monitor, by making sure to set it to
Noneif the workspace is not tiling. Previously any floating workspace would be restored from cache with a tiling BSP layout.Related to this discussion on Discord
However this entire code is based on the premise that the
device_idis always the same for the same devices. However there have been comments on discord stating that this isn't true, however I've not been able to confirm this and the users have not given any proof of this happening (they might simply be confusing it since it's a weird string similar between monitors...)I think the changes from this PR should fix most issues that people have been having with multiple monitors (specially with 3 or more monitors). But it's probably better to not merge this until we can get some users to test it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.