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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
master← Head:feat/focus-floating-improved📝 Commits (5)
d266429feat(wm): track focused floating window1023e64feat(wm): focus floats depending on direction28a00f6feat(wm): show float windows in order on layer toggle4429427fix(test): fix test_locked_containers_toggle_float414d208refactor: 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_windowsfrom aVec<Window>to aRing<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.