feat: adding support for changing the size of windows during window resize events to aerospike. Also cleaning up imports and simplifying some of the settings logic.

This commit is contained in:
Lucas Oskorep
2026-02-25 11:33:12 -05:00
parent 7aecfe2514
commit 805762625c
8 changed files with 388 additions and 409 deletions

View File

@@ -1,20 +1,21 @@
import GLib from "gi://GLib";
export type QueuedEvent = {
name: string;
callback: () => void;
}
const queuedEvents: QueuedEvent[] = [];
const pendingEvents: Map<string, QueuedEvent> = new Map();
export default function queueEvent(event: QueuedEvent, interval = 200) {
queuedEvents.push(event);
pendingEvents.set(event.name, event);
GLib.timeout_add(GLib.PRIORITY_DEFAULT, interval, () => {
const e = queuedEvents.pop()
if (e) {
const e = pendingEvents.get(event.name);
if (e && e === event) {
pendingEvents.delete(event.name);
e.callback();
}
return queuedEvents.length !== 0;
return GLib.SOURCE_REMOVE;
});
}
}