feat(screenshot): add island snap targets (#3881)

port 2.0

(cherry picked from commit 1e31015acb)
This commit is contained in:
Huỳnh Thiện Lộc authored and dux-ci[bot] committed 2026-10-23 14:51:30 +00:00
1 parent 36ebe0e3ef
commit a680e1bd39
2 files changed
+93

No files matched your search

@@ -1,32 +0,0 @@
pragma Singleton
import QtQuick
import Quickshell
Singleton {
property var hosts: ({})
function key(screenName, barId) {
return JSON.stringify([screenName ?? "", barId ?? ""]);
}
function register(key, host) {
if (hosts[key] === host)
return;
const next = Object.assign({}, hosts);
next[key] = host;
hosts = next;
}
function unregister(key, host) {
if (!(key in hosts) || (host && hosts[key] !== host))
return;
const next = Object.assign({}, hosts);
delete next[key];
hosts = next;
}
function hostFor(screenName, barId) {
return hosts[key(screenName, barId)] ?? null;
}
}