remove min-ratio setting and enforcement
- Drop minRatio parameter from container.adjustBoundary; guard is now newLeft/newRight <= 0 (i.e. only prevent a pane from inverting) - Remove _getMinRatio() helper and all call sites in windowManager.ts - Remove Window Sizing preferences group and min-window-size-percent spin button from prefs.ts - Remove min-window-size-percent GSettings key from schema XML
This commit is contained in:
@@ -55,12 +55,5 @@
|
||||
<description>Resets all window size ratios in the active window's container to equal splits</description>
|
||||
</key>
|
||||
|
||||
<key name="min-window-size-percent" type="d">
|
||||
<default>0.10</default>
|
||||
<range min="0.01" max="0.49"/>
|
||||
<summary>Minimum window size percentage</summary>
|
||||
<description>Minimum fraction of a container that any single window may occupy when resizing boundaries</description>
|
||||
</key>
|
||||
|
||||
</schema>
|
||||
</schemalist>
|
||||
@@ -182,41 +182,6 @@ export default class AerospikeExtensions extends ExtensionPreferences {
|
||||
})
|
||||
);
|
||||
|
||||
// Create sizing group
|
||||
const sizingGroup = new Adw.PreferencesGroup({
|
||||
title: _('Window Sizing'),
|
||||
});
|
||||
page.add(sizingGroup);
|
||||
|
||||
// Minimum window size percentage spinner
|
||||
const minSizeRow = new Adw.ActionRow({
|
||||
title: _('Minimum Window Size'),
|
||||
subtitle: _('Smallest fraction of a container any window may occupy when resizing (e.g. 0.10 = 10%)'),
|
||||
});
|
||||
sizingGroup.add(minSizeRow);
|
||||
|
||||
const minSizeSpin = new Gtk.SpinButton({
|
||||
adjustment: new Gtk.Adjustment({
|
||||
lower: 0.01,
|
||||
upper: 0.49,
|
||||
step_increment: 0.01,
|
||||
page_increment: 0.05,
|
||||
value: settings.get_double('min-window-size-percent'),
|
||||
}),
|
||||
digits: 2,
|
||||
valign: Gtk.Align.CENTER,
|
||||
});
|
||||
minSizeRow.add_suffix(minSizeSpin);
|
||||
minSizeRow.set_activatable_widget(minSizeSpin);
|
||||
|
||||
minSizeSpin.connect('value-changed', () => {
|
||||
settings.set_double('min-window-size-percent', minSizeSpin.get_value());
|
||||
});
|
||||
|
||||
settings.connect('changed::min-window-size-percent', () => {
|
||||
minSizeSpin.set_value(settings.get_double('min-window-size-percent'));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Helper function to create a keybinding mapping object
|
||||
|
||||
@@ -111,6 +111,7 @@ export default class WindowContainer {
|
||||
|
||||
removeWindow(win_id: number): void {
|
||||
if (this._tiledWindowLookup.has(win_id)) {
|
||||
// Get index before deleting from lookup to avoid race condition
|
||||
const index = this._getIndexOfWindow(win_id);
|
||||
this._tiledWindowLookup.delete(win_id);
|
||||
if (index !== -1) {
|
||||
@@ -193,9 +194,7 @@ export default class WindowContainer {
|
||||
|
||||
// ─── Boundary Adjustment ─────────────────────────────────────────────────────
|
||||
|
||||
// Shifts the boundary between item[boundaryIndex] and item[boundaryIndex+1] by
|
||||
// deltaPixels. Returns false if the delta would violate minRatio on either side.
|
||||
adjustBoundary(boundaryIndex: number, deltaPixels: number, minRatio: number = 0.10): boolean {
|
||||
adjustBoundary(boundaryIndex: number, deltaPixels: number): boolean {
|
||||
if (boundaryIndex < 0 || boundaryIndex >= this._tiledItems.length - 1) {
|
||||
Logger.warn(`adjustBoundary: invalid boundaryIndex ${boundaryIndex}`);
|
||||
return false;
|
||||
@@ -208,8 +207,8 @@ export default class WindowContainer {
|
||||
const newLeft = this._splitRatios[boundaryIndex] + ratioDelta;
|
||||
const newRight = this._splitRatios[boundaryIndex + 1] - ratioDelta;
|
||||
|
||||
if (newLeft < minRatio || newRight < minRatio) {
|
||||
Logger.log(`adjustBoundary: clamped — newLeft=${newLeft.toFixed(3)}, newRight=${newRight.toFixed(3)}, min=${minRatio}`);
|
||||
if (newLeft <= 0 || newRight <= 0) {
|
||||
Logger.log(`adjustBoundary: clamped — newLeft=${newLeft.toFixed(3)}, newRight=${newRight.toFixed(3)}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,10 +58,6 @@ export default class WindowManager implements IWindowManager {
|
||||
this._settings = settings;
|
||||
}
|
||||
|
||||
private _getMinRatio(): number {
|
||||
return this._settings.get_double('min-window-size-percent');
|
||||
}
|
||||
|
||||
public enable(): void {
|
||||
Logger.log("Starting Aerospike Window Manager");
|
||||
this.instantiateDisplaySignals();
|
||||
@@ -334,21 +330,20 @@ export default class WindowManager implements IWindowManager {
|
||||
if (itemIndex === -1) return;
|
||||
|
||||
const isHorizontal = container._orientation === 0;
|
||||
const minRatio = this._getMinRatio();
|
||||
|
||||
// E/S edge → boundary after the item; W/N edge → boundary before it.
|
||||
let adjusted = false;
|
||||
if (isHorizontal) {
|
||||
if (op === Meta.GrabOp.RESIZING_E || op === Meta.GrabOp.RESIZING_NE || op === Meta.GrabOp.RESIZING_SE) {
|
||||
adjusted = container.adjustBoundary(itemIndex, dx, minRatio);
|
||||
adjusted = container.adjustBoundary(itemIndex, dx);
|
||||
} else if (op === Meta.GrabOp.RESIZING_W || op === Meta.GrabOp.RESIZING_NW || op === Meta.GrabOp.RESIZING_SW) {
|
||||
adjusted = container.adjustBoundary(itemIndex - 1, dx, minRatio);
|
||||
adjusted = container.adjustBoundary(itemIndex - 1, dx);
|
||||
}
|
||||
} else {
|
||||
if (op === Meta.GrabOp.RESIZING_S || op === Meta.GrabOp.RESIZING_SE || op === Meta.GrabOp.RESIZING_SW) {
|
||||
adjusted = container.adjustBoundary(itemIndex, dy, minRatio);
|
||||
adjusted = container.adjustBoundary(itemIndex, dy);
|
||||
} else if (op === Meta.GrabOp.RESIZING_N || op === Meta.GrabOp.RESIZING_NE || op === Meta.GrabOp.RESIZING_NW) {
|
||||
adjusted = container.adjustBoundary(itemIndex - 1, dy, minRatio);
|
||||
adjusted = container.adjustBoundary(itemIndex - 1, dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user