Skip to content

Commit e6cc673

Browse files
committed
fix(shell): repair dead forceMonitor setting + guard HA tile null-deref
- notifications config block was named 'monitor' but the NotificationPopup widget and the Settings -> Interface controls all read 'forceMonitor' — so the setting did nothing and the popup logged a null-deref every frame. Rename to forceMonitor. - HomeAssistantPanel.hasDetail/iconFor split a null entityId during Repeater construction; guard both for a null modelData.
1 parent 7a364d6 commit e6cc673

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

quickshell/ii/modules/common/Config.qml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,13 @@ Singleton {
399399

400400
property JsonObject notifications: JsonObject {
401401
property int timeout: 7000
402-
property JsonObject monitor: JsonObject {
402+
// Pin notification popups to a specific monitor. Named forceMonitor to match the
403+
// NotificationPopup widget and the Settings → Interface controls (the old name
404+
// "monitor" matched nothing, so the setting was dead and the widget logged a
405+
// null-deref every frame).
406+
property JsonObject forceMonitor: JsonObject {
403407
property bool enable: false
404-
property string name: "" // Name of the monitor to show notifications on, like "eDP-1". Find out with 'hyprctl monitors' command
408+
property string name: "" // Monitor to pin popups to, like "eDP-1". Find with 'hyprctl monitors'
405409
}
406410
}
407411

quickshell/ii/modules/ii/sidebarLeft/homeAssistant/HomeAssistantPanel.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Item {
1616

1717
// Entities that have sub-controls worth an expand affordance.
1818
function hasDetail(entityId) {
19+
if (!entityId)
20+
return false; // delegate modelData is transiently null during Repeater construction
1921
const d = entityId.split(".")[0];
2022
if (d === "climate" || d === "media_player" || d === "fan" || d === "cover" || d === "vacuum")
2123
return true;
@@ -25,6 +27,8 @@ Item {
2527
}
2628

2729
function iconFor(entityId) {
30+
if (!entityId)
31+
return "help"; // delegate modelData is transiently null during Repeater construction
2832
const d = entityId.split(".")[0];
2933
switch (d) {
3034
case "light":

0 commit comments

Comments
 (0)