From e023faaedb12daae443290eac3eda5515e2c8b3b Mon Sep 17 00:00:00 2001 From: Lucas Oskorep Date: Thu, 26 Feb 2026 21:21:29 -0500 Subject: [PATCH] fix: tab bars no longer shown in overview. Tab bars show name of app with pipe and then title of the app --- extension.ts | 13 +++++++++---- ...org.gnome.shell.extensions.aerospike.gschema.xml | 2 +- src/wm/container.ts | 10 ++++++++++ src/wm/monitor.ts | 13 ++++++++++++- src/wm/tabBar.ts | 2 +- src/wm/window.ts | 9 +++++++-- src/wm/windowManager.ts | 8 ++++++++ 7 files changed, 48 insertions(+), 9 deletions(-) diff --git a/extension.ts b/extension.ts index 8bd0ccf..fcc5ca4 100644 --- a/extension.ts +++ b/extension.ts @@ -19,10 +19,15 @@ export default class aerospike extends Extension { } enable() { - Logger.log("STARTING AEROSPIKE!") - this.bindSettings(); - this.setupKeybindings(); - this.windowManager.enable() + try { + Logger.log("STARTING AEROSPIKE!") + this.bindSettings(); + this.setupKeybindings(); + this.windowManager.enable() + Logger.log("AEROSPIKE ENABLED SUCCESSFULLY") + } catch (e) { + Logger.error("AEROSPIKE ENABLE FAILED", e); + } } disable() { diff --git a/schemas/org.gnome.shell.extensions.aerospike.gschema.xml b/schemas/org.gnome.shell.extensions.aerospike.gschema.xml index 4cbda08..b029d9f 100644 --- a/schemas/org.gnome.shell.extensions.aerospike.gschema.xml +++ b/schemas/org.gnome.shell.extensions.aerospike.gschema.xml @@ -44,7 +44,7 @@ - comma']]]> + comma']]]> Toggle active container orientation Toggles the orientation of the container holding the active window between horizontal and vertical diff --git a/src/wm/container.ts b/src/wm/container.ts index 584d438..09c751d 100644 --- a/src/wm/container.ts +++ b/src/wm/container.ts @@ -158,6 +158,16 @@ export default class WindowContainer { return this._activeTabIndex; } + hideTabBar(): void { + this._tabBar?.hide(); + } + + showTabBar(): void { + if (this.isTabbed() && this._tabBar) { + this._tabBar.show(); + } + } + addWindow(winWrap: WindowWrapper): void { this._tiledItems.push(winWrap); this._tiledWindowLookup.set(winWrap.getWindowId(), winWrap); diff --git a/src/wm/monitor.ts b/src/wm/monitor.ts index b020cb7..63d430a 100644 --- a/src/wm/monitor.ts +++ b/src/wm/monitor.ts @@ -1,7 +1,6 @@ import {WindowWrapper} from "./window.js"; import {Rect} from "../utils/rect.js"; import {Logger} from "../utils/logger.js"; -import Meta from "gi://Meta"; import WindowContainer from "./container.js"; @@ -73,6 +72,18 @@ export default class Monitor { this._workspaces.push(new WindowContainer(this._workArea)); } + hideTabBars(): void { + for (const container of this._workspaces) { + container.hideTabBar(); + } + } + + showTabBars(): void { + for (const container of this._workspaces) { + container.showTabBar(); + } + } + itemDragged(item: WindowWrapper, x: number, y: number): void { this._workspaces[item.getWorkspace()].itemDragged(item, x, y); } diff --git a/src/wm/tabBar.ts b/src/wm/tabBar.ts index 55c0857..b324ad1 100644 --- a/src/wm/tabBar.ts +++ b/src/wm/tabBar.ts @@ -43,7 +43,7 @@ export class TabBar { track_hover: true, x_expand: true, child: new St.Label({ - text: item.getTitle(), + text: item.getTabLabel(), style_class: 'aerospike-tab-label', y_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER, diff --git a/src/wm/window.ts b/src/wm/window.ts index 79541c5..da1406a 100644 --- a/src/wm/window.ts +++ b/src/wm/window.ts @@ -47,8 +47,13 @@ export class WindowWrapper { return this._window.get_frame_rect(); } - getTitle(): string { - return this._window.get_title() ?? 'Untitled'; + getTabLabel(): string { + const appName = this._window.get_wm_class() ?? ''; + const title = this._window.get_title() ?? 'Untitled'; + if (appName && appName.toLowerCase() !== title.toLowerCase()) { + return `${appName} | ${title}`; + } + return title; } hideWindow(): void { diff --git a/src/wm/windowManager.ts b/src/wm/windowManager.ts index c0e519a..ee209f0 100644 --- a/src/wm/windowManager.ts +++ b/src/wm/windowManager.ts @@ -132,10 +132,16 @@ export default class WindowManager implements IWindowManager { Logger.log("HIDING OVERVIEW") this._showingOverview = false; this._tileMonitors(); + for (const monitor of this._monitors.values()) { + monitor.showTabBars(); + } }), Main.overview.connect("showing", () => { this._showingOverview = true; Logger.log("SHOWING OVERVIEW"); + for (const monitor of this._monitors.values()) { + monitor.hideTabBars(); + } }), ]; } @@ -434,6 +440,8 @@ export default class WindowManager implements IWindowManager { for (const monitor of this._monitors.values()) { monitor.tileWindows(); } + } catch (e) { + Logger.error("_tileMonitors FAILED", e); } finally { this._isTiling = false; }