fix: tab bars no longer shown in overview. Tab bars show name of app with pipe and then title of the app

This commit is contained in:
Lucas Oskorep
2026-02-26 21:21:29 -05:00
parent 0cc35c95b4
commit e023faaedb
7 changed files with 48 additions and 9 deletions

View File

@@ -19,10 +19,15 @@ export default class aerospike extends Extension {
} }
enable() { enable() {
try {
Logger.log("STARTING AEROSPIKE!") Logger.log("STARTING AEROSPIKE!")
this.bindSettings(); this.bindSettings();
this.setupKeybindings(); this.setupKeybindings();
this.windowManager.enable() this.windowManager.enable()
Logger.log("AEROSPIKE ENABLED SUCCESSFULLY")
} catch (e) {
Logger.error("AEROSPIKE ENABLE FAILED", e);
}
} }
disable() { disable() {

View File

@@ -44,7 +44,7 @@
</key> </key>
<key name="toggle-orientation" type="as"> <key name="toggle-orientation" type="as">
<default><![CDATA[['<Super><Shift>comma']]]></default> <default><![CDATA[['<Primary>comma']]]></default>
<summary>Toggle active container orientation</summary> <summary>Toggle active container orientation</summary>
<description>Toggles the orientation of the container holding the active window between horizontal and vertical</description> <description>Toggles the orientation of the container holding the active window between horizontal and vertical</description>
</key> </key>

View File

@@ -158,6 +158,16 @@ export default class WindowContainer {
return this._activeTabIndex; return this._activeTabIndex;
} }
hideTabBar(): void {
this._tabBar?.hide();
}
showTabBar(): void {
if (this.isTabbed() && this._tabBar) {
this._tabBar.show();
}
}
addWindow(winWrap: WindowWrapper): void { addWindow(winWrap: WindowWrapper): void {
this._tiledItems.push(winWrap); this._tiledItems.push(winWrap);
this._tiledWindowLookup.set(winWrap.getWindowId(), winWrap); this._tiledWindowLookup.set(winWrap.getWindowId(), winWrap);

View File

@@ -1,7 +1,6 @@
import {WindowWrapper} from "./window.js"; import {WindowWrapper} from "./window.js";
import {Rect} from "../utils/rect.js"; import {Rect} from "../utils/rect.js";
import {Logger} from "../utils/logger.js"; import {Logger} from "../utils/logger.js";
import Meta from "gi://Meta";
import WindowContainer from "./container.js"; import WindowContainer from "./container.js";
@@ -73,6 +72,18 @@ export default class Monitor {
this._workspaces.push(new WindowContainer(this._workArea)); 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 { itemDragged(item: WindowWrapper, x: number, y: number): void {
this._workspaces[item.getWorkspace()].itemDragged(item, x, y); this._workspaces[item.getWorkspace()].itemDragged(item, x, y);
} }

View File

@@ -43,7 +43,7 @@ export class TabBar {
track_hover: true, track_hover: true,
x_expand: true, x_expand: true,
child: new St.Label({ child: new St.Label({
text: item.getTitle(), text: item.getTabLabel(),
style_class: 'aerospike-tab-label', style_class: 'aerospike-tab-label',
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,

View File

@@ -47,8 +47,13 @@ export class WindowWrapper {
return this._window.get_frame_rect(); return this._window.get_frame_rect();
} }
getTitle(): string { getTabLabel(): string {
return this._window.get_title() ?? 'Untitled'; 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 { hideWindow(): void {

View File

@@ -132,10 +132,16 @@ export default class WindowManager implements IWindowManager {
Logger.log("HIDING OVERVIEW") Logger.log("HIDING OVERVIEW")
this._showingOverview = false; this._showingOverview = false;
this._tileMonitors(); this._tileMonitors();
for (const monitor of this._monitors.values()) {
monitor.showTabBars();
}
}), }),
Main.overview.connect("showing", () => { Main.overview.connect("showing", () => {
this._showingOverview = true; this._showingOverview = true;
Logger.log("SHOWING OVERVIEW"); 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()) { for (const monitor of this._monitors.values()) {
monitor.tileWindows(); monitor.tileWindows();
} }
} catch (e) {
Logger.error("_tileMonitors FAILED", e);
} finally { } finally {
this._isTiling = false; this._isTiling = false;
} }