mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: focused_container ignores monocle containers #383
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?
Originally created by @alex-ds13 on GitHub (May 21, 2024).
Describe the bug
Most commands that relate to the focused window don't take into account if a monocle is open or not. For example if you have 2 windows on a workspace, then set one of them to a monocle and then send the close command, the window on the monocle stays open and it is the other one (the hidden one) that gets closed. From what I understand the issue is that these commands call
focused_windowwhich then callsfocused_containerwhich reads directly from containers without looking first if there is a monocle container and so it returns the wrong window.The problem seems to be that workspace's
containersuse aRing<Container>which implements it's ownfocused_containerfunction that simply gets the focused one from thecontainersvec. However when toggling a monocle the container that is used for the monocle is removed from thecontainersvec. Maybe thefocused_containerfunction needs to be implemented as a new function on the workspace so that it can properly check for monocle containers, or the monocle container shouldn't remove the container and simply have its index stored (@LGUG2Z is it really necessary to remove it?).To Reproduce
Steps to reproduce the behavior:
Expected behavior
The focused window on the monocle should be the one to be closed, not the other one.
Screenshots and Videos
Add screenshots and videos to help explain your problem.
Operating System
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22631 N/A Build 22631
komorebic checkOutputKOMOREBI_CONFIG_HOME detected: C:\Users\Alex\.config\komorebi
Looking for configuration files in C:\Users\Alex\.config\komorebi
Found komorebi.json; this file can be passed to the start command with the --config flag
Found C:\Users\Alex\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
Additional context
I'm currently using the master version. I'm not sure if the bug is present on previous versions.
@LGUG2Z commented on GitHub (May 21, 2024):
Both the Close and the Minimize handlers should be making calls from the Workspace rather than the Window to check for monocle, maximized and floating windows before looking at managed windows; I'll update this before the next release.
@alex-ds13 commented on GitHub (May 21, 2024):
Thank you! The query commands for
focused-containerandfocused-windowmight need to be changed as well to do the same, but that isn't that important since it is just a query.