mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1343] [MERGED] fix(wm): use preferred id when caching monitors #1339
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/1343
Author: @alex-ds13
Created: 3/13/2025
Status: ✅ Merged
Merged: 3/13/2025
Merged by: @LGUG2Z
Base:
master← Head:fix/use-preferred-id-on-cache📝 Commits (1)
c68f79bfix(wm): use preferred id when caching monitors📊 Changes
6 files changed (+38 additions, -17 deletions)
View changed files
📝
komorebi/src/lib.rs(+3 -2)📝
komorebi/src/monitor_reconciliator/mod.rs(+23 -3)📝
komorebi/src/process_command.rs(+1 -1)📝
komorebi/src/static_config.rs(+8 -8)📝
komorebi/src/window_manager.rs(+1 -1)📝
komorebi/src/windows_api.rs(+2 -2)📄 Description
Use the preferred id set by the user as the key when caching monitors. This way if a user is having issues with the
device_idon their system they can use theserial_number_idondisplay_index_preferences. If instead a user is having issues with theserial_number_idthey can make sure to use thedevice_idondisplay_index_preferences. Komorebi will use the preferred one as a key when caching the monitors.@LGUG2Z This PR also includes a change of the
DISPLAY_INDEX_PREFERENCESfrom aMutextoRwLock. I believe theRwLockis better since it allows multiple readers at the same time, while the mutex blocks on all calls even if you just want to read or compare some value. For display index preferences (same thing applies to other existing mutexes) most times we access it is a read-only access. We only ever change it when applying a config or when a command is used to change it. Every other use is a read-only use so it doesn't make sense to block on those situations.If you don't think this is a necessary change I can remove it from this PR though! Just say the word!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.