feat: percentage-based container sizing with live boundary resize

- Add _splitRatios[] to WindowContainer — each child owns a fraction of
  the parent that always sums to 1.0; bounds are computed via prefix-sum
  so the last item absorbs rounding remainder (no pixel gaps)
- addWindow/removeWindow reset to equal splits; itemDragged swaps only
  items (ratios stay slot-based) so windows take the size of the slot
  they move into
- Add adjustBoundary() for live edge-drag resizing clamped to a
  configurable minimum (default 10%, schema key min-window-size-percent)
- Add reset-ratios keybinding (Ctrl+Z) that resets the active container
  to equal splits via WindowManager.resetActiveContainerRatios()
- Connect size-changed signal alongside position-changed so east/south
  edge drags (width-only changes) are detected and the adjacent window
  is repositioned live
- Replace LIFO pop() event queue with name-keyed Map so duplicate events
  collapse to the latest callback and timers never fight each other
- Remove redundant move_frame() before move_resize_frame(); fix retry
  condition to use symmetric pixel tolerance
- Add _isTiling re-entrancy guard around all tileWindows() call sites
  so compositor position-changed callbacks cannot recurse
- Remove double tileWindows() call in monitor.tileWindows() (move()
  already calls it internally)
This commit is contained in:
Lucas Oskorep
2026-02-24 17:26:27 -05:00
parent 3d2da0a4bc
commit 20bac71b45
7 changed files with 454 additions and 82 deletions

View File

@@ -63,6 +63,11 @@ export default class aerospike extends Extension {
this.refreshKeybinding('toggle-orientation');
});
this.settings.connect('changed::reset-ratios', () => {
log(`Reset ratios keybinding changed to: ${this.settings.get_strv('reset-ratios')}`);
this.refreshKeybinding('reset-ratios');
});
this.settings.connect('changed::dropdown-option', () => {
log(`Dropdown option changed to: ${this.settings.get_string('dropdown-option')}`);
});
@@ -108,6 +113,11 @@ export default class aerospike extends Extension {
this.windowManager.toggleActiveContainerOrientation();
});
break;
case 'reset-ratios':
this.bindKeybinding('reset-ratios', () => {
this.windowManager.resetActiveContainerRatios();
});
break;
}
}
@@ -142,6 +152,10 @@ export default class aerospike extends Extension {
this.bindKeybinding('toggle-orientation', () => {
this.windowManager.toggleActiveContainerOrientation();
});
this.bindKeybinding('reset-ratios', () => {
this.windowManager.resetActiveContainerRatios();
});
}
private bindKeybinding(settingName: string, callback: () => void) {