mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1006] [CLOSED] Feature: handle windows that match any float_rules as float instead of being ignored #1169
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/1006
Author: @alex-ds13
Created: 9/24/2024
Status: ❌ Closed
Base:
master← Head:feature/float-rules-as-float📝 Commits (3)
5c52febfeat(wm): add new window_container_behaviour option9498489feat(cli): add new window_container_behaviour commands10772a7feat(wm): stop ignoring windows matched by float_rules📊 Changes
6 files changed (+73 additions, -11 deletions)
View changed files
📝
komorebi-client/src/lib.rs(+1 -0)📝
komorebi/src/core/mod.rs(+4 -0)📝
komorebi/src/process_command.rs(+30 -6)📝
komorebi/src/process_event.rs(+17 -3)📝
komorebi/src/window_manager.rs(+2 -1)📝
komorebic/src/main.rs(+19 -1)📄 Description
This PR builds on top of the #986
This PR requires the
WindowContainerBehaviour::Floatintroduced on that PR, as such it includes the commits from that PR as well. The fix suggested from this PR is just the last commit, so in order to ignore the bigger changes from the other PR it is best to look just at the changes from the last commit (they are quite simple...)WHAT DOES THIS PR DO?
It makes it so windows matched by any floating rule won't simply be ignored by komorebi, but
instead it will still handle the window by using the
WindowContainerBehaviour::Floatintroducedon the other PR mentioned above.
This means that those windows will still be tied to a specific workspace and only be shown on that
workspace instead of showing everywhere.
This would fix issues like the #990 one.
There is one thing that almost everyone asks for when first starting using komorebi, which is a way
to restart komorebi with the current state. I believe that this hasn't been implemented yet in part
because there was no good way to handle the cases where a monitor no longer exists when restarting
again. (@LGUG2Z feel free to correct me if this isn't the case and there are other issues with it)
These PRs could make it so we would be able to restart with the previous state and any window that was
on a no longer existing monitor could be opened on the currently focused workspace as floating. This
way the user would immediately see all the windows that couldn't be handled and they can manually move
them to wherever they like.
This is just an idea and I've haven't implemented nor tried to do so on these PR's yet!
ISSUES OR QUESTIONS WITH THIS PR
The windows set to floating by a floating rule can still become managed by using the command
toggle-floator by moving them to another workspace that is tiled. This might not be wanted,since this windows were added to said rule usually because they don't behave well when tiled.
This can probably be fixed by either having another vector on the workspace (like
floating_windowsand
forced_floating_windows) or by changing thefloating_windowsvector to have a wrapping structthat holds the window and some info:
There might still be a need to create a
ignored_rulesalong with the currentfloat_rulessince there might be some apps that really need to be ignored, or that a user might prefer to have ignored instead of being handled asFloat.Currently,
floating_windowsaren't properly handled by commands, most commands when calledcheck for the focused container, however the floating windows are never set to focused so this
will result in a lot of users complaining that the floating windows are being ignored when they
try to do some operation on them but instead that operation is applied to the previously managed
focused window instead. This should probably be fixed before any of this is merged to master.
Currently, when changing workspaces the newly focused workspace shows the focused container last,
meaning that if some floating window was on top before you changed to another workspace, now it
will show behind the focused container.
Allowing
floating_windowsto be focusable like mentioned above would fix this issue.This would fix issues like #984
Some questions that need to be answered before pushing with this:
WindowContainerBehaviourbefore moving the window and creating a tiled container for it?
WindowContainerBehaviourper workspace? (this might be out of the scopeof this PR but it is related to this so I decided to leave the question here anyway)
TODO
should_manage = falsewere windows that matched a floating rule identifier and if that is the case I force theWindowContainerBehaviour::Floatwhen they are created. But this could probably be better handled if instead of returning a bool from theshould_manage()function we returned some:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.