upgrade to gnome 49

This commit is contained in:
Lucas Oskorep
2025-09-24 00:55:24 -04:00
parent 2b86856a97
commit 265ff05436
6 changed files with 620 additions and 572 deletions

View File

@@ -3,7 +3,7 @@ import {Rect} from "../utils/rect.js";
import queueEvent from "../utils/events.js";
import {Logger} from "../utils/logger.js";
import Meta from "gi://Meta";
import Mtk from "@girs/mtk-16";
import Mtk from "@girs/mtk-17";
import WindowContainer from "./container.js";
import Window = Meta.Window;

View File

@@ -4,6 +4,7 @@ import {IWindowManager} from "./windowManager.js";
import {Logger} from "../utils/logger.js";
import {Rect} from "../utils/rect.js";
import WindowContainer from "./container.js";
import queueEvent from "../utils/events.js";
type WindowMinimizedHandler = (window: WindowWrapper) => void;
@@ -90,7 +91,7 @@ export class WindowWrapper {
}
}),
this._window.connect('notify::maximized-horizontally', () => {
if (this._window.get_maximized()) {
if (this._window.is_maximized()) {
Logger.log(`Window maximized: ${windowId}`);
} else {
Logger.log(`Window unmaximized: ${windowId}`);
@@ -121,13 +122,13 @@ export class WindowWrapper {
}
}
safelyResizeWindow(rect: Rect): void {
safelyResizeWindow(rect: Rect, _retry: number = 2): void {
// Keep minimal logging
if (this._dragging) {
Logger.info("STOPPED RESIZE BECAUSE ITEM IS BEING DRAGGED")
return;
}
Logger.log("SAFELY RESIZE", rect.x, rect.y, rect.width, rect.height);
// Logger.log("SAFELY RESIZE", rect.x, rect.y, rect.width, rect.height);
const actor = this._window.get_compositor_private();
if (!actor) {
@@ -137,11 +138,20 @@ export class WindowWrapper {
let windowActor = this._window.get_compositor_private() as Clutter.Actor;
if (!windowActor) return;
windowActor.remove_all_transitions();
Logger.info("MOVING")
// Logger.info("MOVING")
this._window.move_frame(true, rect.x, rect.y);
Logger.info("RESIZING MOVING")
// Logger.info("RESIZING MOVING")
this._window.move_resize_frame(true, rect.x, rect.y, rect.width, rect.height);
let new_rect = this._window.get_frame_rect();
if ( _retry > 0 && (new_rect.x != rect.x || rect.y != new_rect.y || rect.width < new_rect.width || rect.height < new_rect.height)) {
Logger.warn("RESIZING FAILED AS SMALLER", new_rect.x, new_rect.y, new_rect.width, new_rect.height, rect.x, rect.y, rect.width, rect.height);
queueEvent({
name: "attempting_delayed_resize",
callback: () => {
this.safelyResizeWindow(rect, _retry-1);
}
})
}
}

View File

@@ -243,20 +243,15 @@ export default class WindowManager implements IWindowManager {
}
_moveWindowToMonitor(window: Meta.Window, monitorId: number): void {
Logger.info("MOVING WINDOW TO MONITOR", window.get_id(), monitorId);
let wrapped = this._getAndRemoveWrappedWindow(window);
if (wrapped === undefined) {
Logger.error("WINDOW NOT DEFINED")
wrapped = new WindowWrapper(window, this.handleWindowMinimized);
wrapped.connectWindowSignals(this);
}
// wrapped.startDragging()
let new_mon = this._monitors.get(monitorId);
new_mon?.addWindow(wrapped)
Logger.info("UPDATE MONITOR", new_mon);
this._grabbedWindowMonitor = monitorId;
// wrapped.stopDragging();
}
public handleWindowPositionChanged(winWrap: WindowWrapper): void {
@@ -281,7 +276,6 @@ export default class WindowManager implements IWindowManager {
if (monitorIndex !== this._grabbedWindowMonitor) {
this._changingGrabbedMonitor = true;
Logger.log("CHANGING MONITOR FOR WINDOW");
this._moveWindowToMonitor(winWrap.getWindow(), monitorIndex);
this._changingGrabbedMonitor = false
}
@@ -384,7 +378,7 @@ export default class WindowManager implements IWindowManager {
Logger.info("class", window.get_wm_class());
Logger.info("class", window.get_wm_class_instance());
return this.block_titles.some((title) => {
if (window.get_title() === title) {
if (window.get_wm_class() === title) {
Logger.log("WINDOW BLOCKED FROM TILING", window.get_title());
return true;
}