feat: initial commit with multi-monitor support

This commit is contained in:
Lucas Oskorep
2025-04-18 03:22:35 -04:00
parent cbaafc6e08
commit e5a7a0d96b
3 changed files with 191 additions and 119 deletions

View File

@@ -10,14 +10,22 @@ export type Signal = {
}
export class WindowWrapper {
_window: Meta.Window;
_signals: Signal[];
readonly _window: Meta.Window;
readonly _signals: Signal[];
constructor(window: Meta.Window) {
this._window = window;
this._signals = [];
}
getWindow(): Meta.Window {
return this._window;
}
getWindowId(): number {
return this._window.get_id();
}
connectWindowSignals(
windowManager: IWindowManager,
): void {
@@ -26,9 +34,9 @@ export class WindowWrapper {
// Handle window destruction
const destroyId = this._window.connect('unmanaging', () => {
const destroyId = this._window.connect('unmanaging', window => {
Logger.log("REMOVING WINDOW", windowId);
windowManager.handleWindowClosed(windowId)
windowManager.handleWindowClosed(this)
});
this._signals.push({name: 'unmanaging', id: destroyId});
@@ -82,11 +90,11 @@ export class WindowWrapper {
// If this was the active window, find a new one
windowManager.syncActiveWindow()
// Retile remaining windows
windowManager._tileWindows();
windowManager._tileMonitors();
} else if (!this._window.minimized) {
Logger.log(`Window unminimized: ${windowId}`);
windowManager.addWindow(this._window);
// windowManager.addWindow(this._window);
}
});