summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-16 01:55:20 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-16 01:59:20 +1100
commit33c1c694de3c214306f72c16f7581cd93886dc6b (patch)
treec7e72db99b3b3f0682343131c8bbf0c6268ee655
parentinternal: no async loaders (diff)
downloadcaelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.tar.gz
caelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.tar.bz2
caelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.zip
internal: fix errors due to sync loaders
-rw-r--r--modules/background/Visualiser.qml2
-rw-r--r--modules/bar/components/workspaces/ActiveIndicator.qml6
-rw-r--r--modules/bar/components/workspaces/OccupiedBg.qml11
-rw-r--r--modules/bar/components/workspaces/SpecialWorkspaces.qml2
-rw-r--r--modules/bar/components/workspaces/Workspaces.qml2
-rw-r--r--modules/bar/popouts/Wrapper.qml2
-rw-r--r--modules/controlcenter/Panes.qml6
-rw-r--r--modules/controlcenter/Session.qml4
-rw-r--r--modules/drawers/Drawers.qml2
9 files changed, 20 insertions, 17 deletions
diff --git a/modules/background/Visualiser.qml b/modules/background/Visualiser.qml
index f6020da..c9bb9ef 100644
--- a/modules/background/Visualiser.qml
+++ b/modules/background/Visualiser.qml
@@ -15,7 +15,7 @@ Item {
required property ShellScreen screen
required property Wallpaper wallpaper
- readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || Hypr.monitorFor(screen).activeWorkspace.toplevels.values.every(t => t.lastIpcObject.floating))
+ readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || (Hypr.monitorFor(screen)?.activeWorkspace?.toplevels?.values.every(t => t.lastIpcObject?.floating) ?? true))
property real offset: shouldBeActive ? 0 : screen.height * 0.2
opacity: shouldBeActive ? 1 : 0
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml
index 3e265e2..dae54b3 100644
--- a/modules/bar/components/workspaces/ActiveIndicator.qml
+++ b/modules/bar/components/workspaces/ActiveIndicator.qml
@@ -18,9 +18,9 @@ StyledRect {
return i % Config.bar.workspaces.shown;
}
- property real leading: workspaces.itemAt(currentWsIdx)?.y ?? 0
- property real trailing: workspaces.itemAt(currentWsIdx)?.y ?? 0
- property real currentSize: workspaces.itemAt(currentWsIdx)?.size ?? 0
+ property real leading: workspaces.count > 0 ? workspaces.itemAt(currentWsIdx)?.y ?? 0 : 0
+ property real trailing: workspaces.count > 0 ? workspaces.itemAt(currentWsIdx)?.y ?? 0 : 0
+ property real currentSize: workspaces.count > 0 ? workspaces.itemAt(currentWsIdx)?.size ?? 0 : 0
property real offset: Math.min(leading, trailing)
property real size: {
const s = Math.abs(leading - trailing) + currentSize;
diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml
index 0364575..da6fa55 100644
--- a/modules/bar/components/workspaces/OccupiedBg.qml
+++ b/modules/bar/components/workspaces/OccupiedBg.qml
@@ -16,12 +16,15 @@ Item {
property list<var> pills: []
onOccupiedChanged: {
+ if (!occupied) return;
let count = 0;
const start = groupOffset;
const end = start + Config.bar.workspaces.shown;
for (const [ws, occ] of Object.entries(occupied)) {
if (ws > start && ws <= end && occ) {
- if (!occupied[ws - 1]) {
+ const isFirstInGroup = Number(ws) === start + 1;
+ const isLastInGroup = Number(ws) === end;
+ if (isFirstInGroup || !occupied[ws - 1]) {
if (pills[count])
pills[count].start = ws;
else
@@ -30,7 +33,7 @@ Item {
}));
count++;
}
- if (!occupied[ws + 1])
+ if ((isLastInGroup || !occupied[ws + 1]) && pills[count - 1])
pills[count - 1].end = ws;
}
}
@@ -48,8 +51,8 @@ Item {
required property var modelData
- readonly property Workspace start: root.workspaces.itemAt(getWsIdx(modelData.start)) ?? null
- readonly property Workspace end: root.workspaces.itemAt(getWsIdx(modelData.end)) ?? null
+ readonly property Workspace start: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.start)) ?? null : null
+ readonly property Workspace end: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.end)) ?? null : null
function getWsIdx(ws: int): int {
let i = ws - 1;
diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml
index 866022a..ad85af8 100644
--- a/modules/bar/components/workspaces/SpecialWorkspaces.qml
+++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml
@@ -15,7 +15,7 @@ Item {
required property ShellScreen screen
readonly property HyprlandMonitor monitor: Hypr.monitorFor(screen)
- readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name ?? ""
+ readonly property string activeSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? monitor : Hypr.focusedMonitor)?.lastIpcObject?.specialWorkspace?.name ?? ""
layer.enabled: true
layer.effect: OpacityMask {
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml
index ad20ab6..bfa80ab 100644
--- a/modules/bar/components/workspaces/Workspaces.qml
+++ b/modules/bar/components/workspaces/Workspaces.qml
@@ -13,7 +13,7 @@ StyledClippingRect {
required property ShellScreen screen
- readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject.specialWorkspace.name !== ""
+ readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject?.specialWorkspace?.name !== ""
readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hypr.monitorFor(screen).activeWorkspace?.id ?? 1) : Hypr.activeWsId
readonly property var occupied: Hypr.workspaces.values.reduce((acc, curr) => {
diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml
index 64ee6db..fc74222 100644
--- a/modules/bar/popouts/Wrapper.qml
+++ b/modules/bar/popouts/Wrapper.qml
@@ -35,8 +35,8 @@ Item {
if (mode === "winfo") {
detachedMode = mode;
} else {
- detachedMode = "any";
queuedMode = mode;
+ detachedMode = "any";
}
focus = true;
}
diff --git a/modules/controlcenter/Panes.qml b/modules/controlcenter/Panes.qml
index eba7de1..c239b91 100644
--- a/modules/controlcenter/Panes.qml
+++ b/modules/controlcenter/Panes.qml
@@ -108,7 +108,7 @@ ClippingRectangle {
const diff = Math.abs(root.session.activeIndex - pane.paneIndex);
const isActivePane = diff === 0;
let shouldBeActive = false;
-
+
if (!layout.initialOpeningComplete) {
shouldBeActive = isActivePane;
} else {
@@ -120,7 +120,7 @@ ClippingRectangle {
shouldBeActive = layout.animationComplete;
}
}
-
+
loader.active = shouldBeActive;
}
@@ -132,7 +132,7 @@ ClippingRectangle {
active: false
Component.onCompleted: {
- pane.updateActive();
+ Qt.callLater(pane.updateActive);
}
onActiveChanged: {
diff --git a/modules/controlcenter/Session.qml b/modules/controlcenter/Session.qml
index 0408a1a..5c4bb05 100644
--- a/modules/controlcenter/Session.qml
+++ b/modules/controlcenter/Session.qml
@@ -16,6 +16,6 @@ QtObject {
readonly property EthernetState ethernet: EthernetState {}
readonly property LauncherState launcher: LauncherState {}
- onActiveChanged: activeIndex = panes.indexOf(active)
- onActiveIndexChanged: active = panes[activeIndex]
+ onActiveChanged: activeIndex = Math.max(0, panes.indexOf(active))
+ onActiveIndexChanged: if (panes[activeIndex]) active = panes[activeIndex]
}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 9fc38bd..00f9596 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -47,7 +47,7 @@ Variants {
return 0;
const mon = Hypr.monitorFor(screen);
- if (mon?.lastIpcObject.specialWorkspace.name || mon?.activeWorkspace?.lastIpcObject.windows > 0)
+ if (mon?.lastIpcObject?.specialWorkspace?.name || mon?.activeWorkspace?.lastIpcObject?.windows > 0)
return 0;
const thresholds = [];