[PR #1370] [MERGED] feat: floating windows improved #1361

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

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1370
Author: @alex-ds13
Created: 3/21/2025
Status: Merged
Merged: 3/26/2025
Merged by: @LGUG2Z

Base: masterHead: feat/focus-floating-improved


📝 Commits (5)

  • d266429 feat(wm): track focused floating window
  • 1023e64 feat(wm): focus floats depending on direction
  • 28a00f6 feat(wm): show float windows in order on layer toggle
  • 4429427 fix(test): fix test_locked_containers_toggle_float
  • 414d208 refactor: comment the new ring implementation

📊 Changes

6 files changed (+364 additions, -87 deletions)

View changed files

📝 komorebi/src/monitor.rs (+13 -13)
📝 komorebi/src/process_command.rs (+38 -4)
📝 komorebi/src/process_event.rs (+2 -2)
📝 komorebi/src/ring.rs (+32 -0)
📝 komorebi/src/window_manager.rs (+265 -41)
📝 komorebi/src/workspace.rs (+14 -27)

📄 Description

This PR changes the floating_windows from a Vec<Window> to a Ring<Window> which allows us to keep track of the focused floating window. This combined with the existing layer switch allows us to know when we should focus the focused container or the focused floating window.

The 2nd commit of this PR adds the ability to focus the floating windows depending on the direction used. It takes into account the top left corner of each window and uses that to look for the closest top left corner in the direction provided.
If there are no windows found on that direction it then checks if it can focus across monitor.
This commit is a WIP since I want some feedback on the result of the directional focus first.

The 3rd commit of this PR raises and lowers all the floating windows so that they show up with the smaller windows on top and the bigger windows on the bottom when we toggle between layers. This is mostly a cosmetic change since it looks better to have all floating windows showing up when toggling between layers, without it a bigger window could be in front of all other windows (which still happens if the bigger window is the focused one, but on any other case it looks nice, at least for me...)

I would like some feedback on these changes before cleaning up all the debug code and making it ready for merge.


🔄 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/1370 **Author:** [@alex-ds13](https://github.com/alex-ds13) **Created:** 3/21/2025 **Status:** ✅ Merged **Merged:** 3/26/2025 **Merged by:** [@LGUG2Z](https://github.com/LGUG2Z) **Base:** `master` ← **Head:** `feat/focus-floating-improved` --- ### 📝 Commits (5) - [`d266429`](https://github.com/LGUG2Z/komorebi/commit/d266429b889213ac195faa1af2a0275aba6b27e9) feat(wm): track focused floating window - [`1023e64`](https://github.com/LGUG2Z/komorebi/commit/1023e64b98b640936eb9b9491f89adf33eea04de) feat(wm): focus floats depending on direction - [`28a00f6`](https://github.com/LGUG2Z/komorebi/commit/28a00f66da8dc784adfae0c9cc04601c0e809647) feat(wm): show float windows in order on layer toggle - [`4429427`](https://github.com/LGUG2Z/komorebi/commit/442942711149f3e502b1075b20c8f723fa72dda7) fix(test): fix test_locked_containers_toggle_float - [`414d208`](https://github.com/LGUG2Z/komorebi/commit/414d20897c4a849255e590082478fa63b750800b) refactor: comment the new ring implementation ### 📊 Changes **6 files changed** (+364 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `komorebi/src/monitor.rs` (+13 -13) 📝 `komorebi/src/process_command.rs` (+38 -4) 📝 `komorebi/src/process_event.rs` (+2 -2) 📝 `komorebi/src/ring.rs` (+32 -0) 📝 `komorebi/src/window_manager.rs` (+265 -41) 📝 `komorebi/src/workspace.rs` (+14 -27) </details> ### 📄 Description This PR changes the `floating_windows` from a `Vec<Window>` to a `Ring<Window>` which allows us to keep track of the focused floating window. This combined with the existing layer switch allows us to know when we should focus the focused container or the focused floating window. The 2nd commit of this PR adds the ability to focus the floating windows depending on the direction used. It takes into account the top left corner of each window and uses that to look for the closest top left corner in the direction provided. If there are no windows found on that direction it then checks if it can focus across monitor. This commit is a WIP since I want some feedback on the result of the directional focus first. The 3rd commit of this PR raises and lowers all the floating windows so that they show up with the smaller windows on top and the bigger windows on the bottom when we toggle between layers. This is mostly a cosmetic change since it looks better to have all floating windows showing up when toggling between layers, without it a bigger window could be in front of all other windows (which still happens if the bigger window is the focused one, but on any other case it looks nice, at least for me...) I would like some feedback on these changes before cleaning up all the debug code and making it ready for merge. <!-- Please follow the Conventional Commits specification. If you need to update your PR with changes from `master`, please run `git rebase master`. By opening this PR, you confirm that you have read and understood this project's `CONTRIBUTING.md`. --> --- <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:55:01 +01:00
adam closed this issue 2026-01-05 14:55:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1361