mirror of
https://github.com/zoriya/fairy.git
synced 2025-12-06 05:36:09 +00:00
Track already created windows
This commit is contained in:
@@ -18,6 +18,7 @@ var Layout = GObject.registerClass(
|
||||
// */
|
||||
// this._monitorsTags = new Map();
|
||||
|
||||
// TODO: duplicate this layout for each monitors.
|
||||
this._layout = {
|
||||
type: "tiled",
|
||||
nmaster: 1,
|
||||
@@ -48,7 +49,6 @@ var Layout = GObject.registerClass(
|
||||
const window = this.windows.find((x) => x.actor === actor);
|
||||
if (!window) return null;
|
||||
this.windows = this.windows.filter((x) => x !== window);
|
||||
console.log("Popped", this.windows.length);
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,9 @@ var WindowManager = GObject.registerClass(
|
||||
|
||||
enable() {
|
||||
this._bindSignals();
|
||||
// TODO: Add all existing windows to the layout and render.
|
||||
// this.render();
|
||||
for (const window of global.display.list_all_windows())
|
||||
this.trackWindow(window);
|
||||
this.renderAll();
|
||||
}
|
||||
|
||||
// Stolen from https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/183
|
||||
@@ -109,6 +110,17 @@ var WindowManager = GObject.registerClass(
|
||||
this._layout.newWindow(window);
|
||||
}
|
||||
|
||||
renderAll() {
|
||||
const monN = global.display.get_n_monitors();
|
||||
// TODO: Support different tags on different monitors.
|
||||
const tags = global.display
|
||||
.get_workspace_manager()
|
||||
.get_active_workspace_index() + 1;
|
||||
for (let mon = 0; mon < monN; mon++) {
|
||||
this.render(mon, tags);
|
||||
}
|
||||
}
|
||||
|
||||
renderForWindow(window) {
|
||||
const mon = window.get_monitor();
|
||||
// TODO: The on_all_workspaces handling is faulty.
|
||||
|
||||
Reference in New Issue
Block a user