diff --git a/schemas/org.gnome.shell.extensions.aerospike.gschema.xml b/schemas/org.gnome.shell.extensions.aerospike.gschema.xml index 1fdda35..f0f74a4 100644 --- a/schemas/org.gnome.shell.extensions.aerospike.gschema.xml +++ b/schemas/org.gnome.shell.extensions.aerospike.gschema.xml @@ -55,12 +55,5 @@ Resets all window size ratios in the active window's container to equal splits - - 0.10 - - Minimum window size percentage - Minimum fraction of a container that any single window may occupy when resizing boundaries - - \ No newline at end of file diff --git a/src/prefs/prefs.ts b/src/prefs/prefs.ts index cae6096..4daa950 100644 --- a/src/prefs/prefs.ts +++ b/src/prefs/prefs.ts @@ -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 diff --git a/src/wm/container.ts b/src/wm/container.ts index 34b71d5..9ff86d7 100644 --- a/src/wm/container.ts +++ b/src/wm/container.ts @@ -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; } diff --git a/src/wm/windowManager.ts b/src/wm/windowManager.ts index 5be1abb..fb9906b 100644 --- a/src/wm/windowManager.ts +++ b/src/wm/windowManager.ts @@ -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); } }