Compare commits
9 Commits
feat/windo
...
50ceb02124
Author | SHA1 | Date | |
---|---|---|---|
|
50ceb02124 | ||
|
717c240d70 | ||
|
822a7bd2e4 | ||
|
4543c98de8 | ||
|
d59a0fef6d | ||
|
ed661b3fa6 | ||
|
6a19b77742 | ||
|
7b0f37f3f9 | ||
|
e1e240924a |
7
ambient.d.ts
vendored
7
ambient.d.ts
vendored
@@ -2,3 +2,10 @@ import "@girs/gjs";
|
|||||||
import "@girs/gjs/dom";
|
import "@girs/gjs/dom";
|
||||||
import "@girs/gnome-shell/ambient";
|
import "@girs/gnome-shell/ambient";
|
||||||
import "@girs/gnome-shell/extensions/global";
|
import "@girs/gnome-shell/extensions/global";
|
||||||
|
|
||||||
|
// Extend Meta.Window with our custom property
|
||||||
|
declare namespace Meta {
|
||||||
|
interface Window {
|
||||||
|
_aerospikeData?: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
364
extension.ts
364
extension.ts
@@ -1,65 +1,32 @@
|
|||||||
import GLib from 'gi://GLib';
|
|
||||||
import St from 'gi://St';
|
|
||||||
import Meta from 'gi://Meta';
|
import Meta from 'gi://Meta';
|
||||||
import {Extension, ExtensionMetadata} from 'resource:///org/gnome/shell/extensions/extension.js';
|
import {Extension, ExtensionMetadata} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||||
import Mtk from "@girs/mtk-16";
|
|
||||||
|
|
||||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||||
import Gio from 'gi://Gio';
|
import Gio from 'gi://Gio';
|
||||||
import Shell from 'gi://Shell';
|
import Shell from 'gi://Shell';
|
||||||
// import cairo from "cairo";
|
import WindowManager from './src/windowManager.js'
|
||||||
// import Shell from 'gi://Shell';
|
import {Logger} from "./src/utils/logger.js";
|
||||||
// import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
||||||
|
|
||||||
type WinWrapper = {
|
|
||||||
window: Meta.Window | null;
|
|
||||||
signals: Signal[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Signal = {
|
|
||||||
name: string;
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default class aerospike extends Extension {
|
export default class aerospike extends Extension {
|
||||||
settings: Gio.Settings;
|
settings: Gio.Settings;
|
||||||
keyBindings: Map<string, number>;
|
keyBindings: Map<string, number>;
|
||||||
borderActor: St.Widget | null;
|
windowManager: WindowManager;
|
||||||
focusWindowSignals: any[];
|
|
||||||
lastFocusedWindow: Meta.Window | null;
|
|
||||||
_focusSignal: number | null;
|
|
||||||
_windowCreateId: number | null;
|
|
||||||
_windows: Map<number, WinWrapper>;
|
|
||||||
_activeWindowId: number | null;
|
|
||||||
|
|
||||||
constructor(metadata: ExtensionMetadata) {
|
constructor(metadata: ExtensionMetadata) {
|
||||||
super(metadata);
|
super(metadata);
|
||||||
this.settings = this.getSettings('org.gnome.shell.extensions.aerospike');
|
this.settings = this.getSettings('org.gnome.shell.extensions.aerospike');
|
||||||
this.keyBindings = new Map();
|
this.keyBindings = new Map();
|
||||||
// Initialize instance variables
|
this.windowManager = new WindowManager();
|
||||||
this.borderActor = null;
|
|
||||||
this.focusWindowSignals = [];
|
|
||||||
this.lastFocusedWindow = null;
|
|
||||||
this._focusSignal = null;
|
|
||||||
this._windowCreateId = null;
|
|
||||||
this._windows = new Map<number, WinWrapper>();
|
|
||||||
this._activeWindowId = null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
console.log("STARTING AEROSPIKE!")
|
Logger.log("STARTING AEROSPIKE!")
|
||||||
this._captureExistingWindows();
|
|
||||||
// Connect window signals
|
|
||||||
this._windowCreateId = global.display.connect(
|
|
||||||
'window-created',
|
|
||||||
(display, window) => {
|
|
||||||
this.handleWindowCreated(window);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.bindSettings();
|
this.bindSettings();
|
||||||
|
this.windowManager.enable()
|
||||||
|
}
|
||||||
|
|
||||||
|
disable() {
|
||||||
|
this.windowManager.disable()
|
||||||
|
this.removeKeybindings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -166,315 +133,6 @@ export default class aerospike extends Extension {
|
|||||||
this.keyBindings.set(settingName, keyBindingAction);
|
this.keyBindings.set(settingName, keyBindingAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleWindowCreated(window: Meta.Window) {
|
|
||||||
console.log("WINDOW CREATED", window);
|
|
||||||
if (!this._isWindowTileable(window)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("WINDOW IS TILABLE");
|
|
||||||
const actor = window.get_compositor_private();
|
|
||||||
if (!actor) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this._addWindow(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
_captureExistingWindows() {
|
|
||||||
console.log("CAPTURING WINDOWS")
|
|
||||||
const workspace = global.workspace_manager.get_active_workspace();
|
|
||||||
const windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
|
|
||||||
console.log("WINDOWS", windows);
|
|
||||||
windows.forEach(window => {
|
|
||||||
if (this._isWindowTileable(window)) {
|
|
||||||
this._addWindow(window);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this._tileWindows();
|
|
||||||
}
|
|
||||||
|
|
||||||
getUsableMonitorSpace(window: Meta.Window) {
|
|
||||||
// Get the current workspace
|
|
||||||
const workspace = window.get_workspace();
|
|
||||||
|
|
||||||
// Get the monitor index that this window is on
|
|
||||||
const monitorIndex = window.get_monitor();
|
|
||||||
|
|
||||||
// Get the work area
|
|
||||||
const workArea = workspace.get_work_area_for_monitor(monitorIndex);
|
|
||||||
|
|
||||||
return {
|
|
||||||
x: workArea.x,
|
|
||||||
y: workArea.y,
|
|
||||||
width: workArea.width,
|
|
||||||
height: workArea.height
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Function to safely resize a window after it's ready
|
|
||||||
safelyResizeWindow(win: Meta.Window, x: number, y: number, width: number, height: number): void {
|
|
||||||
const actor = win.get_compositor_private();
|
|
||||||
|
|
||||||
if (!actor) {
|
|
||||||
console.log("No actor available, can't resize safely yet");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set a flag to track if the resize has been done
|
|
||||||
let resizeDone = false;
|
|
||||||
|
|
||||||
// Connect to the first-frame signal
|
|
||||||
const id = actor.connect('first-frame', () => {
|
|
||||||
// Disconnect the signal handler
|
|
||||||
actor.disconnect(id);
|
|
||||||
|
|
||||||
if (!resizeDone) {
|
|
||||||
resizeDone = true;
|
|
||||||
|
|
||||||
// Add a small delay
|
|
||||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => {
|
|
||||||
try {
|
|
||||||
this.resizeWindow(win, x, y, width, height);
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Error resizing window:", e);
|
|
||||||
}
|
|
||||||
return GLib.SOURCE_REMOVE;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fallback timeout in case the first-frame signal doesn't fire
|
|
||||||
// (for windows that are already mapped)
|
|
||||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, () => {
|
|
||||||
if (!resizeDone) {
|
|
||||||
resizeDone = true;
|
|
||||||
try {
|
|
||||||
this.resizeWindow(win, x, y, width, height);
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Error resizing window (fallback):", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return GLib.SOURCE_REMOVE;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
resizeWindow(win: Meta.Window, x:number, y:number, width:number, height:number) {
|
|
||||||
// First, ensure window is not maximized or fullscreen
|
|
||||||
if (win.get_maximized()) {
|
|
||||||
console.log("WINDOW MAXIMIZED")
|
|
||||||
win.unmaximize(Meta.MaximizeFlags.BOTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (win.is_fullscreen()) {
|
|
||||||
console.log("WINDOW IS FULLSCREEN")
|
|
||||||
win.unmake_fullscreen();
|
|
||||||
}
|
|
||||||
console.log("WINDOW", win.get_window_type(), win.allows_move());
|
|
||||||
console.log("MONITOR INFO", this.getUsableMonitorSpace(win));
|
|
||||||
console.log("NEW_SIZE", x, y, width, height);
|
|
||||||
// win.move_resize_frame(false, 50, 50, 300, 300);
|
|
||||||
win.move_resize_frame(false, x, y, width, height);
|
|
||||||
console.log("RESIZED WINDOW", win.get_frame_rect().height, win.get_frame_rect().width, win.get_frame_rect().x, win.get_frame_rect().y);
|
|
||||||
}
|
|
||||||
|
|
||||||
_addWindow(window: Meta.Window) {
|
|
||||||
const windowId = window.get_id();
|
|
||||||
|
|
||||||
// Connect to window signals
|
|
||||||
const signals: Signal[] = [];
|
|
||||||
console.log("ADDING WINDOW", window);
|
|
||||||
// const act = window.get_compositor_private();
|
|
||||||
// const id = act.connect('first-frame', _ => {
|
|
||||||
// this.resizeWindow(window);
|
|
||||||
// act.disconnect(id);
|
|
||||||
// });
|
|
||||||
|
|
||||||
const destroyId = window.connect('unmanaging', () => {
|
|
||||||
console.log("REMOVING WINDOW", windowId);
|
|
||||||
this._handleWindowClosed(windowId);
|
|
||||||
});
|
|
||||||
signals.push({name: 'unmanaging', id: destroyId});
|
|
||||||
|
|
||||||
const focusId = window.connect('notify::has-focus', () => {
|
|
||||||
if (window.has_focus()) {
|
|
||||||
this._activeWindowId = windowId;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
signals.push({name: 'notify::has-focus', id: focusId});
|
|
||||||
|
|
||||||
// Add window to managed windows
|
|
||||||
this._windows.set(windowId, {
|
|
||||||
window: window,
|
|
||||||
signals: signals
|
|
||||||
});
|
|
||||||
|
|
||||||
// If this is the first window, make it the active one
|
|
||||||
if (this._windows.size === 1 || window.has_focus()) {
|
|
||||||
this._activeWindowId = windowId;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._tileWindows();
|
|
||||||
}
|
|
||||||
|
|
||||||
_handleWindowClosed(windowId: number) {
|
|
||||||
print("closing window", windowId);
|
|
||||||
const windowData = this._windows.get(windowId);
|
|
||||||
if (!windowData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disconnect signals
|
|
||||||
if (windowData.signals) {
|
|
||||||
windowData.signals.forEach(signal => {
|
|
||||||
try {
|
|
||||||
|
|
||||||
if (windowData.window != null) {
|
|
||||||
windowData.window.disconnect(signal.id);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// Window might already be gone
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove from managed windows
|
|
||||||
this._windows.delete(windowId);
|
|
||||||
|
|
||||||
// If this was the active window, find a new one
|
|
||||||
if (this._activeWindowId === windowId && this._windows.size > 0) {
|
|
||||||
this._activeWindowId = Array.from(this._windows.keys())[0];
|
|
||||||
} else if (this._windows.size === 0) {
|
|
||||||
this._activeWindowId = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retile remaining windows
|
|
||||||
this._tileWindows();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_tileWindows() {
|
|
||||||
console.log("TILING WINDOWS")
|
|
||||||
const workspace = global.workspace_manager.get_active_workspace();
|
|
||||||
const workArea = workspace.get_work_area_for_monitor(
|
|
||||||
global.display.get_primary_monitor()
|
|
||||||
);
|
|
||||||
console.log("Workspace", workspace);
|
|
||||||
console.log("WorkArea", workArea);
|
|
||||||
|
|
||||||
// Get all windows for current workspace
|
|
||||||
const windows = Array.from(this._windows.values())
|
|
||||||
.filter(({window}) => {
|
|
||||||
|
|
||||||
if (window != null) {
|
|
||||||
return window.get_workspace() === workspace;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.map(({window}) => window);
|
|
||||||
|
|
||||||
if (windows.length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._tileHorizontally(windows, workArea)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
_tileHorizontally(windows: (Meta.Window | null)[], workArea: Mtk.Rectangle) {
|
|
||||||
const windowWidth = Math.floor(workArea.width / windows.length);
|
|
||||||
|
|
||||||
windows.forEach((window, index) => {
|
|
||||||
const x = workArea.x + (index * windowWidth);
|
|
||||||
const rect = {
|
|
||||||
x: x,
|
|
||||||
y: workArea.y,
|
|
||||||
width: windowWidth,
|
|
||||||
height: workArea.height
|
|
||||||
};
|
|
||||||
if (window != null) {
|
|
||||||
this.safelyResizeWindow(window, rect.x, rect.y, rect.width, rect.height);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
_isWindowTileable(window: Meta.Window) {
|
|
||||||
if (!window || !window.get_compositor_private()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const windowType = window.get_window_type();
|
|
||||||
console.log("WINDOW TYPE", windowType);
|
|
||||||
// Skip certain types of windows
|
|
||||||
return !window.is_skip_taskbar() &&
|
|
||||||
windowType !== Meta.WindowType.DESKTOP &&
|
|
||||||
windowType !== Meta.WindowType.DOCK &&
|
|
||||||
windowType !== Meta.WindowType.DIALOG &&
|
|
||||||
windowType !== Meta.WindowType.MODAL_DIALOG &&
|
|
||||||
windowType !== Meta.WindowType.UTILITY &&
|
|
||||||
windowType !== Meta.WindowType.MENU;
|
|
||||||
}
|
|
||||||
|
|
||||||
// _updateBorder(window: Meta.Window) {
|
|
||||||
// console.log("UPDATING THE BORDER")
|
|
||||||
// // Clear the previous border
|
|
||||||
// this._clearBorder();
|
|
||||||
// // Set a new border for the currently focused window
|
|
||||||
// if (window) {
|
|
||||||
// this._setBorder(window);
|
|
||||||
// this.lastFocusedWindow = window;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// _setBorder(window: Meta.Window) {
|
|
||||||
// console.log("SETTING THE BORDER")
|
|
||||||
// if (!window) return;
|
|
||||||
//
|
|
||||||
// const rect = window.get_frame_rect();
|
|
||||||
// if (!rect) return;
|
|
||||||
//
|
|
||||||
// // Create a new actor for the border using St.Widget
|
|
||||||
// this.borderActor = new St.Widget({
|
|
||||||
// name: 'active-window-border',
|
|
||||||
// // style_class: 'active-window-border',
|
|
||||||
// reactive: false,
|
|
||||||
// x: rect.x - 1, // Adjust for border width
|
|
||||||
// y: rect.y - 1,
|
|
||||||
// width: rect.width + 2, // Increased to accommodate border
|
|
||||||
// height: rect.height + 2,
|
|
||||||
// // Initial style with default color.ts
|
|
||||||
// // style: `border: 4px solid hsl(${this.hue}, 100%, 50%); border-radius: 5px;`,
|
|
||||||
// // style: `border: 2px solid rgba(0, 0, 0, 0.5); border-radius: 3px;`
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// // Add the border actor to the UI group
|
|
||||||
// global.window_group.add_child(this.borderActor);
|
|
||||||
// // Main.layoutManager.uiGroup.add_child(this.borderActor);
|
|
||||||
//
|
|
||||||
// // Listen to window's changes in position and size
|
|
||||||
// this.focusWindowSignals?.push(window.connect('position-changed', () => this._updateBorderPosition(window)));
|
|
||||||
// this.focusWindowSignals?.push(window.connect('size-changed', () => this._updateBorderPosition(window)));
|
|
||||||
// this.focusWindowSignals?.push(window.connect('unmanaged', () => this._clearBorder()));
|
|
||||||
//
|
|
||||||
// this._updateBorderPosition(window);
|
|
||||||
//
|
|
||||||
// // Start the color.ts cycling
|
|
||||||
// this._startColorCycle();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
disable() {
|
|
||||||
console.log("DISABLED AEROSPIKE!")
|
|
||||||
// Disconnect the focus signal and remove any existing borders
|
|
||||||
if (this._focusSignal) {
|
|
||||||
global.display.disconnect(this._focusSignal);
|
|
||||||
this._focusSignal = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear the border on the last focused window if it exists
|
|
||||||
// this._clearBorder();
|
|
||||||
this.lastFocusedWindow = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
3
justfile
3
justfile
@@ -32,6 +32,9 @@ run:
|
|||||||
|
|
||||||
install-and-run: install run
|
install-and-run: install run
|
||||||
|
|
||||||
|
live-debug:
|
||||||
|
journalctl /usr/bin/gnome-shell -f -o cat | tee debug.log
|
||||||
|
|
||||||
#pack: build
|
#pack: build
|
||||||
# gnome-extensions pack dist \
|
# gnome-extensions pack dist \
|
||||||
# --force \
|
# --force \
|
||||||
|
2
prefs.ts
2
prefs.ts
@@ -1,4 +1,4 @@
|
|||||||
// This file is just a wrapper around the compiled TypeScript code
|
// This file is just a wrapper around the compiled TypeScript code
|
||||||
import MyExtensionPreferences from './src/prefs.js';
|
import MyExtensionPreferences from './src/prefs/prefs.js';
|
||||||
|
|
||||||
export default MyExtensionPreferences;
|
export default MyExtensionPreferences;
|
118
src/container.ts
Normal file
118
src/container.ts
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
import {WindowWrapper} from "./window.js";
|
||||||
|
import {Logger} from "./utils/logger.js";
|
||||||
|
import Mtk from "@girs/mtk-16";
|
||||||
|
import Meta from "gi://Meta";
|
||||||
|
import GLib from "gi://GLib";
|
||||||
|
import queueEvent from "./utils/events.js";
|
||||||
|
import {Rect} from "./utils/rect.js";
|
||||||
|
|
||||||
|
|
||||||
|
export default class WindowContainer {
|
||||||
|
|
||||||
|
_id: number;
|
||||||
|
_windows: Map<number, WindowWrapper>;
|
||||||
|
_minimizedWindows: Map<number, WindowWrapper>;
|
||||||
|
_workArea: Rect;
|
||||||
|
|
||||||
|
constructor(monitorId: number, workspaceArea: Rect) {
|
||||||
|
this._windows = new Map<number, WindowWrapper>();
|
||||||
|
this._minimizedWindows = new Map<number, WindowWrapper>();
|
||||||
|
const workspace = global.workspace_manager.get_active_workspace();
|
||||||
|
this._id = monitorId;
|
||||||
|
const _workArea = workspace.get_work_area_for_monitor(
|
||||||
|
this._id
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
addWindow(winWrap: WindowWrapper): void {
|
||||||
|
// Add window to managed windows
|
||||||
|
this._windows.set(winWrap.getWindowId(), winWrap);
|
||||||
|
queueEvent({
|
||||||
|
name: "tiling-windows",
|
||||||
|
callback: () => {
|
||||||
|
this._tileWindows();
|
||||||
|
}
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
getWindow(win_id: number): WindowWrapper | undefined {
|
||||||
|
return this._windows.get(win_id)
|
||||||
|
}
|
||||||
|
|
||||||
|
removeWindow(win_id: number): void {
|
||||||
|
this._windows.delete(win_id)
|
||||||
|
// TODO: Should there be re-tiling in this function?
|
||||||
|
this._tileWindows()
|
||||||
|
}
|
||||||
|
|
||||||
|
minimizeWindow(winWrap: WindowWrapper): void {
|
||||||
|
this._windows.delete(winWrap.getWindowId())
|
||||||
|
this._minimizedWindows.set(winWrap.getWindowId(), winWrap)
|
||||||
|
}
|
||||||
|
|
||||||
|
unminimizeWindow(winWrap: WindowWrapper): void {
|
||||||
|
if (this._minimizedWindows.has(winWrap.getWindowId())) {
|
||||||
|
this._windows.set(winWrap.getWindowId(), winWrap);
|
||||||
|
this._minimizedWindows.delete(winWrap.getWindowId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectSignals(): void {
|
||||||
|
this._windows.forEach((window) => {
|
||||||
|
window.disconnectWindowSignals();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAllWindows(): void {
|
||||||
|
this._windows.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
_tileWindows() {
|
||||||
|
Logger.log("TILING WINDOWS ON MONITOR", this._id)
|
||||||
|
const workspace = global.workspace_manager.get_active_workspace();
|
||||||
|
const workArea = workspace.get_work_area_for_monitor(
|
||||||
|
this._id
|
||||||
|
);
|
||||||
|
|
||||||
|
Logger.log("Workspace", workspace);
|
||||||
|
Logger.log("WorkArea", workArea);
|
||||||
|
|
||||||
|
// Get all windows for current workspace
|
||||||
|
|
||||||
|
let windows = this._getTilableWindows(workspace)
|
||||||
|
|
||||||
|
if (windows.length !== 0) {
|
||||||
|
this._tileHorizontally(windows, workArea)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
_getTilableWindows(workspace: Meta.Workspace): WindowWrapper[] {
|
||||||
|
|
||||||
|
return Array.from(this._windows.values())
|
||||||
|
.filter(({_window}) => {
|
||||||
|
Logger.log("TILING WINDOW:", _window.get_id())
|
||||||
|
return _window.get_workspace() === workspace;
|
||||||
|
})
|
||||||
|
.map(x => x);
|
||||||
|
}
|
||||||
|
|
||||||
|
_tileHorizontally(windows: (WindowWrapper)[], workArea: Mtk.Rectangle) {
|
||||||
|
const windowWidth = Math.floor(workArea.width / windows.length);
|
||||||
|
|
||||||
|
windows.forEach((window, index) => {
|
||||||
|
const x = workArea.x + (index * windowWidth);
|
||||||
|
const rect = {
|
||||||
|
x: x,
|
||||||
|
y: workArea.y,
|
||||||
|
width: windowWidth,
|
||||||
|
height: workArea.height
|
||||||
|
};
|
||||||
|
if (window != null) {
|
||||||
|
window.safelyResizeWindow(rect);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
20
src/utils.ts
20
src/utils.ts
@@ -1,20 +0,0 @@
|
|||||||
// Utility functions and type definitions
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for the extension settings
|
|
||||||
*/
|
|
||||||
export interface ExtensionSettings {
|
|
||||||
keybinding1: string[];
|
|
||||||
keybinding2: string[];
|
|
||||||
keybinding3: string[];
|
|
||||||
keybinding4: string[];
|
|
||||||
dropdownOption: string;
|
|
||||||
colorSelection: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log a message with the extension name prefix
|
|
||||||
*/
|
|
||||||
export function log(message: string): void {
|
|
||||||
console.log(`[MyExtension] ${message}`);
|
|
||||||
}
|
|
20
src/utils/events.ts
Normal file
20
src/utils/events.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import GLib from "gi://GLib";
|
||||||
|
|
||||||
|
|
||||||
|
export type QueuedEvent = {
|
||||||
|
name: string;
|
||||||
|
callback: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const queuedEvents: QueuedEvent[] = [];
|
||||||
|
|
||||||
|
export default function queueEvent(event: QueuedEvent, interval = 200) {
|
||||||
|
queuedEvents.push(event);
|
||||||
|
GLib.timeout_add(GLib.PRIORITY_DEFAULT, interval, () => {
|
||||||
|
const e = queuedEvents.pop()
|
||||||
|
if (e) {
|
||||||
|
e.callback();
|
||||||
|
}
|
||||||
|
return queuedEvents.length !== 0;
|
||||||
|
});
|
||||||
|
}
|
30
src/utils/logger.ts
Normal file
30
src/utils/logger.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
export class Logger {
|
||||||
|
|
||||||
|
static fatal(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [FATAL]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static error(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [ERROR]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static warn(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [WARN]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static info(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [INFO]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static debug(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [DEBUG]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static trace(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [TRACE]`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static log(...args: any[]) {
|
||||||
|
console.log(`[Aerospike] [LOG]`, ...args);
|
||||||
|
}
|
||||||
|
}
|
6
src/utils/rect.ts
Normal file
6
src/utils/rect.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export type Rect = {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
}
|
101
src/window.ts
Normal file
101
src/window.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
import Meta from 'gi://Meta';
|
||||||
|
import Clutter from "gi://Clutter";
|
||||||
|
import {IWindowManager} from "./windowManager.js";
|
||||||
|
import {Logger} from "./utils/logger.js";
|
||||||
|
import {Rect} from "./utils/rect.js";
|
||||||
|
|
||||||
|
|
||||||
|
type WindowMinimizedHandler = (window: WindowWrapper) => void;
|
||||||
|
|
||||||
|
export class WindowWrapper {
|
||||||
|
readonly _window: Meta.Window;
|
||||||
|
readonly _windowMinimizedHandler: WindowMinimizedHandler;
|
||||||
|
readonly _signals: number[];
|
||||||
|
|
||||||
|
constructor(window: Meta.Window, winMinimized: WindowMinimizedHandler) {
|
||||||
|
this._window = window;
|
||||||
|
this._signals = [];
|
||||||
|
this._windowMinimizedHandler = winMinimized;
|
||||||
|
}
|
||||||
|
|
||||||
|
getWindow(): Meta.Window {
|
||||||
|
return this._window;
|
||||||
|
}
|
||||||
|
|
||||||
|
getWindowId(): number {
|
||||||
|
return this._window.get_id();
|
||||||
|
}
|
||||||
|
|
||||||
|
connectWindowSignals(
|
||||||
|
windowManager: IWindowManager,
|
||||||
|
): void {
|
||||||
|
const windowId = this._window.get_id()
|
||||||
|
// Handle window destruction
|
||||||
|
this._signals.push(
|
||||||
|
this._window.connect('unmanaging', window => {
|
||||||
|
Logger.log("REMOVING WINDOW", windowId);
|
||||||
|
windowManager.handleWindowClosed(this)
|
||||||
|
}),
|
||||||
|
this._window.connect('notify::minimized', () => {
|
||||||
|
if (this._window.minimized) {
|
||||||
|
Logger.log(`Window minimized: ${windowId}`);
|
||||||
|
windowManager.handleWindowMinimized(this);
|
||||||
|
|
||||||
|
} else if (!this._window.minimized) {
|
||||||
|
Logger.log(`Window unminimized: ${windowId}`);
|
||||||
|
windowManager.handleWindowUnminimized(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
this._window.connect('notify::has-focus', () => {
|
||||||
|
if (this._window.has_focus()) {
|
||||||
|
windowManager._activeWindowId = windowId;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
this._window.connect('notify::maximized-horizontally', () => {
|
||||||
|
if (this._window.get_maximized()) {
|
||||||
|
Logger.log(`Window maximized: ${windowId}`);
|
||||||
|
} else {
|
||||||
|
Logger.log(`Window unmaximized: ${windowId}`);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectWindowSignals(): void {
|
||||||
|
|
||||||
|
if (this._signals) {
|
||||||
|
this._signals.forEach(signal => {
|
||||||
|
try {
|
||||||
|
if (this._window != null) {
|
||||||
|
this._window.disconnect(signal);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Logger.warn("error disconnecting signal", signal, e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is meant to be an exact copy of Forge's move function, renamed to maintain your API
|
||||||
|
safelyResizeWindow(rect: Rect): void {
|
||||||
|
// Keep minimal logging
|
||||||
|
Logger.log("SAFELY RESIZE", rect.x, rect.y, rect.width, rect.height);
|
||||||
|
const actor = this._window.get_compositor_private();
|
||||||
|
|
||||||
|
if (!actor) {
|
||||||
|
Logger.log("No actor available, can't resize safely yet");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let windowActor = this._window.get_compositor_private() as Clutter.Actor;
|
||||||
|
if (!windowActor) return;
|
||||||
|
windowActor.remove_all_transitions();
|
||||||
|
Logger.info("MOVING")
|
||||||
|
this._window.move_frame(true, rect.x, rect.y);
|
||||||
|
Logger.info("RESIZING MOVING")
|
||||||
|
this._window.move_resize_frame(true, rect.x, rect.y, rect.width, rect.height);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
317
src/windowManager.ts
Normal file
317
src/windowManager.ts
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
import Meta from "gi://Meta";
|
||||||
|
import Gio from "gi://Gio";
|
||||||
|
import GLib from "gi://GLib";
|
||||||
|
|
||||||
|
import {WindowWrapper} from './window.js';
|
||||||
|
import * as Main from "resource:///org/gnome/shell/ui/main.js";
|
||||||
|
import Mtk from "@girs/mtk-16";
|
||||||
|
import {Logger} from "./utils/logger.js";
|
||||||
|
import WindowContainer from "./container.js";
|
||||||
|
import {MessageTray} from "@girs/gnome-shell/ui/messageTray";
|
||||||
|
import queueEvent, {QueuedEvent} from "./utils/events.js";
|
||||||
|
|
||||||
|
|
||||||
|
export interface IWindowManager {
|
||||||
|
_activeWindowId: number | null;
|
||||||
|
|
||||||
|
// addWindow(window: Meta.Window): void;
|
||||||
|
|
||||||
|
handleWindowClosed(winWrap: WindowWrapper): void;
|
||||||
|
handleWindowMinimized(winWrap: WindowWrapper): void;
|
||||||
|
handleWindowUnminimized(winWrap: WindowWrapper): void;
|
||||||
|
|
||||||
|
|
||||||
|
// removeFromTree(window: Meta.Window): void;
|
||||||
|
syncActiveWindow(): number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const _UNUSED_MONITOR_ID = -1
|
||||||
|
export default class WindowManager implements IWindowManager {
|
||||||
|
_displaySignals: number[];
|
||||||
|
_windowManagerSignals: number[];
|
||||||
|
_workspaceManagerSignals: number[];
|
||||||
|
_overviewSignals: number[];
|
||||||
|
|
||||||
|
_activeWindowId: number | null;
|
||||||
|
_grabbedWindowMonitor: number;
|
||||||
|
_monitors: Map<number, WindowContainer>;
|
||||||
|
_sessionProxy: Gio.DBusProxy | null;
|
||||||
|
_lockedSignalId: number | null;
|
||||||
|
_isScreenLocked: boolean;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this._displaySignals = [];
|
||||||
|
this._windowManagerSignals = [];
|
||||||
|
this._workspaceManagerSignals = [];
|
||||||
|
this._overviewSignals = [];
|
||||||
|
this._activeWindowId = null;
|
||||||
|
this._grabbedWindowMonitor = _UNUSED_MONITOR_ID;
|
||||||
|
this._monitors = new Map<number, WindowContainer>();
|
||||||
|
this._sessionProxy = null;
|
||||||
|
this._lockedSignalId = null;
|
||||||
|
this._isScreenLocked = false; // Initialize to unlocked state
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enable(): void {
|
||||||
|
Logger.log("Starting Aerospike Window Manager");
|
||||||
|
// Connect window signals
|
||||||
|
this.instantiateDisplaySignals();
|
||||||
|
|
||||||
|
const mon_count = global.display.get_n_monitors();
|
||||||
|
for (let i = 0; i < mon_count; i++) {
|
||||||
|
this._monitors.set(i, new WindowContainer(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.captureExistingWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
instantiateDisplaySignals(): void {
|
||||||
|
this._displaySignals.push(
|
||||||
|
global.display.connect("grab-op-begin", (display, window, op) => {
|
||||||
|
this.handleGrabOpBegin(display, window, op)
|
||||||
|
}),
|
||||||
|
global.display.connect("grab-op-end", (display, window, op) => {
|
||||||
|
this.handleGrabOpEnd(display, window, op)
|
||||||
|
}),
|
||||||
|
global.display.connect("window-entered-monitor", (display, monitor, window) => {
|
||||||
|
Logger.log("WINDOW HAS ENTERED NEW MONITOR!")
|
||||||
|
}),
|
||||||
|
global.display.connect('window-created', (display, window) => {
|
||||||
|
this.handleWindowCreated(display, window);
|
||||||
|
}),
|
||||||
|
global.display.connect("showing-desktop-changed", () => {
|
||||||
|
Logger.log("SHOWING DESKTOP CHANGED");
|
||||||
|
}),
|
||||||
|
global.display.connect("workareas-changed", (display) => {
|
||||||
|
Logger.log("WORK AREAS CHANGED");
|
||||||
|
}),
|
||||||
|
global.display.connect("in-fullscreen-changed", () => {
|
||||||
|
Logger.log("IN FULL SCREEN CHANGED");
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
this._windowManagerSignals = [
|
||||||
|
global.window_manager.connect("show-tile-preview", (_, _metaWindow, _rect, _num) => {
|
||||||
|
Logger.log("SHOW TITLE PREVIEW!")
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
this._workspaceManagerSignals = [
|
||||||
|
global.workspace_manager.connect("showing-desktop-changed", () => {
|
||||||
|
Logger.log("SHOWING DESKTOP CHANGED AT WORKSPACE LEVEL");
|
||||||
|
}),
|
||||||
|
global.workspace_manager.connect("workspace-added", (_, wsIndex) => {
|
||||||
|
Logger.log("WORKSPACE ADDED");
|
||||||
|
}),
|
||||||
|
global.workspace_manager.connect("workspace-removed", (_, wsIndex) => {
|
||||||
|
Logger.log("WORKSPACE REMOVED");
|
||||||
|
}),
|
||||||
|
global.workspace_manager.connect("active-workspace-changed", () => {
|
||||||
|
Logger.log("Active workspace-changed");
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
this._overviewSignals = [
|
||||||
|
Main.overview.connect("hiding", () => {
|
||||||
|
// this.fromOverview = true;
|
||||||
|
Logger.log("HIDING OVERVIEW")
|
||||||
|
// const eventObj = {
|
||||||
|
// name: "focus-after-overview",
|
||||||
|
// callback: () => {
|
||||||
|
// Logger.log("FOCUSING AFTER OVERVIEW");
|
||||||
|
// },
|
||||||
|
// };
|
||||||
|
// this.queueEvent(eventObj);
|
||||||
|
}),
|
||||||
|
Main.overview.connect("showing", () => {
|
||||||
|
// this.toOverview = true;
|
||||||
|
Logger.log("SHOWING OVERVIEW");
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public disable(): void {
|
||||||
|
Logger.log("DISABLED AEROSPIKE WINDOW MANAGER!")
|
||||||
|
// Disconnect the focus signal and remove any existing borders
|
||||||
|
this.disconnectSignals();
|
||||||
|
this.removeAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAllWindows(): void {
|
||||||
|
this._monitors.forEach((monitor: WindowContainer) => {
|
||||||
|
monitor.removeAllWindows();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
disconnectSignals(): void {
|
||||||
|
this.disconnectDisplaySignals();
|
||||||
|
this.disconnectMonitorSignals();
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectMonitorSignals(): void {
|
||||||
|
this._monitors.forEach((monitor: WindowContainer) => {
|
||||||
|
monitor.disconnectSignals();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectDisplaySignals(): void {
|
||||||
|
this._displaySignals.forEach((signal) => {
|
||||||
|
global.display.disconnect(signal)
|
||||||
|
})
|
||||||
|
this._windowManagerSignals.forEach((signal) => {
|
||||||
|
global.window_manager.disconnect(signal)
|
||||||
|
})
|
||||||
|
this._workspaceManagerSignals.forEach((signal) => {
|
||||||
|
global.workspace_manager.disconnect(signal)
|
||||||
|
})
|
||||||
|
this._overviewSignals.forEach((signal) => {
|
||||||
|
Main.overview.disconnect(signal)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
handleGrabOpBegin(display: Meta.Display, window: Meta.Window, op: Meta.GrabOp): void {
|
||||||
|
Logger.log("Grab Op Start");
|
||||||
|
Logger.log(display, window, op)
|
||||||
|
Logger.log(window.get_monitor())
|
||||||
|
this._grabbedWindowMonitor = window.get_monitor();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleGrabOpEnd(display: Meta.Display, window: Meta.Window, op: Meta.GrabOp): void {
|
||||||
|
Logger.log("Grab Op End ", op);
|
||||||
|
Logger.log("primary display", display.get_primary_monitor())
|
||||||
|
var rect = window.get_frame_rect()
|
||||||
|
Logger.info("Release Location", window.get_monitor(), rect.x, rect.y, rect.width, rect.height)
|
||||||
|
const old_mon_id = this._grabbedWindowMonitor;
|
||||||
|
const new_mon_id = window.get_monitor();
|
||||||
|
|
||||||
|
Logger.info("MONITOR MATCH", old_mon_id !== new_mon_id);
|
||||||
|
if (old_mon_id !== new_mon_id) {
|
||||||
|
Logger.trace("MOVING MONITOR");
|
||||||
|
let old_mon = this._monitors.get(old_mon_id);
|
||||||
|
let new_mon = this._monitors.get(new_mon_id);
|
||||||
|
if (old_mon === undefined || new_mon === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let wrapped = old_mon.getWindow(window.get_id())
|
||||||
|
if (wrapped === undefined) {
|
||||||
|
wrapped = new WindowWrapper(window, this.handleWindowMinimized);
|
||||||
|
} else {
|
||||||
|
old_mon.removeWindow(window.get_id())
|
||||||
|
}
|
||||||
|
new_mon.addWindow(wrapped)
|
||||||
|
}
|
||||||
|
this._tileMonitors();
|
||||||
|
Logger.info("monitor_start and monitor_end", this._grabbedWindowMonitor, window.get_monitor());
|
||||||
|
}
|
||||||
|
|
||||||
|
public handleWindowMinimized(winWrap: WindowWrapper): void {
|
||||||
|
Logger.warn("WARNING MINIMIZING WINDOW");
|
||||||
|
Logger.log("WARNING MINIMIZED", winWrap);
|
||||||
|
const monitor_id = winWrap.getWindow().get_monitor()
|
||||||
|
Logger.log("WARNING MINIMIZED", monitor_id);
|
||||||
|
Logger.warn("WARNING MINIMIZED", this._monitors);
|
||||||
|
this._monitors.get(monitor_id)?.minimizeWindow(winWrap);
|
||||||
|
this._tileMonitors()
|
||||||
|
}
|
||||||
|
|
||||||
|
public handleWindowUnminimized(winWrap: WindowWrapper): void {
|
||||||
|
Logger.log("WINDOW UNMINIMIZED");
|
||||||
|
const monitor_id = winWrap.getWindow().get_monitor()
|
||||||
|
this._monitors.get(monitor_id)?.unminimizeWindow(winWrap);
|
||||||
|
this._tileMonitors()
|
||||||
|
}
|
||||||
|
|
||||||
|
public captureExistingWindows() {
|
||||||
|
Logger.log("CAPTURING WINDOWS")
|
||||||
|
const workspace = global.workspace_manager.get_active_workspace();
|
||||||
|
const windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
|
||||||
|
Logger.log("WINDOWS", windows);
|
||||||
|
windows.forEach(window => {
|
||||||
|
if (this._isWindowTileable(window)) {
|
||||||
|
this.addWindowToMonitor(window);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this._tileMonitors();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
handleWindowCreated(display: Meta.Display, window: Meta.Window) {
|
||||||
|
Logger.log("WINDOW CREATED ON DISPLAY", window, display);
|
||||||
|
if (!this._isWindowTileable(window)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Logger.log("WINDOW IS TILABLE");
|
||||||
|
this.addWindowToMonitor(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle window closed event
|
||||||
|
*/
|
||||||
|
handleWindowClosed(window: WindowWrapper): void {
|
||||||
|
|
||||||
|
// window.disconnectWindowSignals()
|
||||||
|
const mon_id = window._window.get_monitor();
|
||||||
|
this._monitors.get(mon_id)?.removeWindow(window.getWindowId());
|
||||||
|
|
||||||
|
// Remove from managed windows
|
||||||
|
this.syncActiveWindow();
|
||||||
|
// Retile remaining windows
|
||||||
|
this._tileMonitors();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public addWindowToMonitor(window: Meta.Window) {
|
||||||
|
Logger.log("ADDING WINDOW TO MONITOR", window, window);
|
||||||
|
var wrapper = new WindowWrapper(window, this.handleWindowMinimized)
|
||||||
|
wrapper.connectWindowSignals(this);
|
||||||
|
// wrapper.connectWindowSignals(this)
|
||||||
|
this._monitors.get(window.get_monitor())?.addWindow(wrapper)
|
||||||
|
}
|
||||||
|
|
||||||
|
_tileMonitors(): void {
|
||||||
|
|
||||||
|
for (const monitor of this._monitors.values()) {
|
||||||
|
monitor._tileWindows()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_isWindowTileable(window: Meta.Window) {
|
||||||
|
|
||||||
|
if (!window || !window.get_compositor_private()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const windowType = window.get_window_type();
|
||||||
|
Logger.log("WINDOW TYPE", windowType);
|
||||||
|
// Skip certain types of windows
|
||||||
|
return !window.is_skip_taskbar() &&
|
||||||
|
windowType !== Meta.WindowType.DESKTOP &&
|
||||||
|
windowType !== Meta.WindowType.DOCK &&
|
||||||
|
windowType !== Meta.WindowType.DIALOG &&
|
||||||
|
windowType !== Meta.WindowType.MODAL_DIALOG &&
|
||||||
|
windowType !== Meta.WindowType.UTILITY &&
|
||||||
|
windowType !== Meta.WindowType.MENU;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Synchronizes the active window with GNOME's currently active window
|
||||||
|
*
|
||||||
|
* This function queries GNOME Shell for the current focused window and
|
||||||
|
* updates the extension's active window tracking to match.
|
||||||
|
*
|
||||||
|
* @returns The window ID of the active window, or null if no window is active
|
||||||
|
*/
|
||||||
|
public syncActiveWindow(): number | null {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
0
src/workspace.ts
Normal file
0
src/workspace.ts
Normal file
@@ -16,7 +16,6 @@
|
|||||||
"src/**/*"
|
"src/**/*"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"extension.ts",
|
"extension.ts"
|
||||||
"winGroup.ts"
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user