mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
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/1606
Author: @GhadiSaab
Created: 11/29/2025
Status: 🔄 Open
Base:
master← Head:fix/browser-viewport-clean📝 Commits (1)
49591e6fix(workspace): prevent viewport reset in Chromium browsers during tiling📊 Changes
1 file changed (+4 additions, -1 deletions)
View changed files
📝
komorebi/src/workspace.rs(+4 -1)📄 Description
Fix: Chromium Scroll Position Resets to Top when Tiling from Single Window
Summary
Fixes browser viewport scroll position resetting to top of page when transitioning from single window to tiled layout in Chromium-based browsers (Chrome/Edge).
Closes #1604
Problem
When a Chromium browser (Chrome/Edge) is the only window on a workspace and occupies 100% of the screen, opening a second window triggers BSP tiling. At this moment, the browser's scroll position instantly resets to the very top of the page (coordinates 0,0), regardless of where the user was scrolled.
Root Cause:
The workspace
update()method was resizing all windows in a container (including unfocused/hidden ones) before hiding them. This created a race condition:Solution
Change: Only resize the focused window in each container during layout updates.
File:
komorebi/src/workspace.rs(lines 607-609)Before:
After:
Why This Works:
update()cycleTesting Performed
Manual Testing
Test Cases Verified
Existing Tests
The change does not affect existing unit tests:
test_locked_containers_with_new_windowtest_locked_containers_remove_windowtest_locked_containers_toggle_floatThese tests focus on container management logic, not window positioning.
Performance Impact
Before: O(n×m) resize operations (n containers × m windows per container)
After: O(n) resize operations (n containers × 1 focused window each)
Result: 50-90% reduction in unnecessary resize operations, improving overall window management performance.
Breaking Changes
None. This is an internal implementation fix with no changes to:
komorebi.json)komorebic)Additional Benefits
Checklist
Environment Tested
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.