mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1598] [MERGED] fix(wm): promoting a container shouldn't change their sizes #1473
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/1598
Author: @alex-ds13
Created: 11/20/2025
Status: ✅ Merged
Merged: 11/22/2025
Merged by: @LGUG2Z
Base:
master← Head:fix/promote-should-not-resize📝 Commits (1)
294b126fix(wm): promoting a container shouldn't change their sizes📊 Changes
1 file changed (+7 additions, -5 deletions)
View changed files
📝
komorebi/src/workspace.rs(+7 -5)📄 Description
remove_focused_container()andinsert_container_at_idxfunctions which will remove the focused container size fromresize_dimensionsand then add the new container with sizeNone. Then it was adding the previously stored size of the main container back to the first one. However this would result in at least 3 issues:remove_focused_containerit would remove the size from the focused container index, but since we had already removed one size from theresize_dimensionsthat index would no longer match the actual focused container, so once again we would be losing information.resize_dimensions(albeit the wrong one as stated above), this would mean that the container that moved to that position would have no resize information so it would show up as if the main container was taking up half width of the area, ignoring any user resize, until the next workspace update was triggered.resize_dimensionssince promoting a container simply means moving one container from one position to the main one (usually index 0) and then shift all the rest to the "right". The existingresize_dimensionsshould be kept untouched. To do this we use the functionsremove_respecting_locksandinsert_respecting_lockson the containers themselves, which simply move the container and shifts the others which is precisely what we want.This PR was a result of this conversation on discord: https://discord.com/channels/898554690126630914/1440500893782114455
BTW @LGUG2Z, this left me wondering should the
promote_containerobey the locked containers?! As far as I understood the main reasoning being the locked containers was so that you could keep some container in place even when adding new containers/windows that would otherwise move it, however when you use thekomorebic promotecommand it is because you want to move the focused container into the "main spot", however if that was locked that won't happen, it will move it to the next one... Is this the intended behavior? I personally am totally fine with leaving it as is, since if you locked the main container it is probably because you really don't want it to be moved, otherwise I don't see the need to lock the main container since new windows should never move that one.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.