[PR #1068] [MERGED] fix(windows_api): correctly handle monitors preference indices #1188

Closed
opened 2026-01-05 14:54:24 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1068
Author: @alex-ds13
Created: 10/18/2024
Status: Merged
Merged: 10/18/2024
Merged by: @LGUG2Z

Base: masterHead: fix/monitors-indices


📝 Commits (1)

  • e9143b2 fix(windows_api): correctly handle monitors preference indices

📊 Changes

1 file changed (+12 additions, -5 deletions)

View changed files

📝 komorebi/src/windows_api.rs (+12 -5)

📄 Description

This should fix a bug where the monitor index preferences might not be properly applied. This would affect users with 3 or more monitors the most.
Fixes #1056
(there might be other issues that are fixed by this, but I didn't have to time to go through all of them and check... might do that later...)

To explain the fix:

  • Previously it was adding placeholders and then inserting the monitor at the correct index, which would shift the rest to the right, which depending on the order could end up with a wrong result
  • Now we add placeholders until the current index (inclusive), then check if the current one at the index we want to put this monitor is a placeholder, if it is we replace it (remove -> insert).

@LGUG2Z I can't properly test this since I've only got two monitors. It is probably better to have someone with 3 or more monitors test this first to make sure it works and doesn't break other stuff. It would be great if you could notify testers on discord! 👍


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/1068 **Author:** [@alex-ds13](https://github.com/alex-ds13) **Created:** 10/18/2024 **Status:** ✅ Merged **Merged:** 10/18/2024 **Merged by:** [@LGUG2Z](https://github.com/LGUG2Z) **Base:** `master` ← **Head:** `fix/monitors-indices` --- ### 📝 Commits (1) - [`e9143b2`](https://github.com/LGUG2Z/komorebi/commit/e9143b2fda7d55ef9f602fd8b341db9e8dafe449) fix(windows_api): correctly handle monitors preference indices ### 📊 Changes **1 file changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `komorebi/src/windows_api.rs` (+12 -5) </details> ### 📄 Description This should fix a bug where the monitor index preferences might not be properly applied. This would affect users with 3 or more monitors the most. Fixes #1056 (there might be other issues that are fixed by this, but I didn't have to time to go through all of them and check... might do that later...) To explain the fix: - Previously it was adding placeholders and then inserting the monitor at the correct index, which would shift the rest to the right, which depending on the order could end up with a wrong result - Now we add placeholders until the current index (inclusive), then check if the current one at the index we want to put this monitor is a placeholder, if it is we replace it (remove -> insert). @LGUG2Z I can't properly test this since I've only got two monitors. It is probably better to have someone with 3 or more monitors test this first to make sure it works and doesn't break other stuff. It would be great if you could notify testers on discord! 👍 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:54:24 +01:00
adam closed this issue 2026-01-05 14:54:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1188