Repository navigation
fix(hyprland): write window rules Hyprland 0.56 accepts, keep DMS windows opaque - #3655
Conversation
|
/claude review |
| @@ -417,7 +415,6 @@ Item { | |||
| readonly property var liveRuleData: (root.windowRules || []).find(rule => rule.id === ruleIdRef) ?? modelData | |||
|
|
|||
| title: liveRuleData.name || liveRuleData.matchCriteria?.appId || liveRuleData.matchCriteria?.title || I18n.tr("Unnamed rule") | |||
There was a problem hiding this comment.
This PR removes the titleColor binding, so disabled rules no longer show a dimmed title. Every rule now looks enabled in the list. The removal looks unrelated to this change, so it was probably a rebase/merge leftover. Restore it:
| title: liveRuleData.name || liveRuleData.matchCriteria?.appId || liveRuleData.matchCriteria?.title || I18n.tr("Unnamed rule") | |
| title: liveRuleData.name || liveRuleData.matchCriteria?.appId || liveRuleData.matchCriteria?.title || I18n.tr("Unnamed rule") | |
| titleColor: liveRuleData.enabled !== false ? Theme.surfaceText : Theme.surfaceVariantText |
There was a problem hiding this comment.
This isn't a regression. Every window rule parser sets Enabled: true (hyprland_parser.go, niri_parser.go, mango_parser.go) and nothing in the UI can disable a rule, so the binding never takes effect. I can easily restore it if kept for a future disable toggle
Claude reviewLooks good overall. One regression to fix before merge.
|
…dows opaque The Lua window-rule writer emitted match keys and effects Hyprland 0.56 does not know: `floating`/`pinned`/`initialised` as match keys and `noborder`/`norounding` as effects. It now writes `float`/`pin` and `border_size = 0`/`rounding = 0`; the parser still reads the old spellings, so existing files load and are rewritten on the next save. "No Rounding" now suppresses the corner radius so a rule has one `rounding` key. The rule editor no longer offers fields the Hyprland writer drops (Window Opening output/workspace, Size Constraints, the Initialised match), and Save is disabled while only one half of a move or size pair is filled. Every window-rule write now reloads the compositor through one helper, which also covers Hyprland. DMS windows draw their own translucent background, so any compositor opacity rule or decoration opacity multiplied on top of it. DMS now keeps a hidden rule for its own app id: `opaque = true` on Hyprland (applied after rule and decoration opacity, independent of order, and leaving the window's own alpha alone) and `opacity 1.0` on niri, which the store keeps last. It is re-added on start when missing and hidden from the rules list and the focused-window menu. Compositor layout gains a Hyprland "Window opacity" slider writing decoration.active_opacity/inactive_opacity; 100 leaves the user's own config in charge. HyprlandService.reloadConfig queues callbacks: Proc keeps one callback per id, so a reload requested while the layout writer's reload was pending dropped its callback and left layout generation stuck.
Hyprland 0.56's Lua window_rule rejects rounding above 20 ("value 24
is more than the maximum of 20") and the rule loses its rounding. The
Hyprland writer now clamps to 20, and the editor slider stops at 20
for every compositor.
1e16ef2 to
8cdf09d
Compare
|
/claude review |
Claude reviewLooks good. The new commit makes the change requested in the earlier review comments. |
Description
This PR fixes window rules on Hyprland 0.56 and stops compositor opacity from dimming DMS's own windows.
The Lua writer emits keys Hyprland 0.56 doesn't know, so the Floating and Pinned match conditions and the No border and No Rounding options do nothing. The same rule written before and after this PR:
DMS windows already draw their own translucent background (Floating windows → Opacity), so any opacity rule or
decoration.*_opacitymultiplies on top of it. A user who wants other apps translucent ends up with an unreadable Settings window, and the only workaround is a hand-written rule.float/pin,border_size = 0/rounding = 0, and dropsinitialised(not a Hyprland 0.56 match key). The parser still reads the old spellings, so existing files load and get rewritten on the next savecom.danklinux.dms:opaque = trueon Hyprland andopacity 1.0on niri. Hyprland appliesopaqueafter rule and decoration opacity regardless of rule order (checked in the v0.56.2 source) and keeps the window's own translucent background. niri has no equivalent, so the rule is kept as the last one in the file. MangoWC is skipped since DMS writes no opacity there. It's hidden from the rules list and the focused-window menudecoration.active_opacity/inactive_opacity. At 100 DMS writes nothing and the user's config appliesHyprlandService.reloadConfigqueues callbacks.Prockeeps one callback per id, so a second reload while the layout writer's was pending dropped its callback, and gaps, borders and window opacity stopped applying until a restart. The cursor writer could already trigger this; the opaque rule's reload on first start makes it much more likelyOne new string: "Window opacity".
A few things worth flagging:
setDmsWindowFloatingRulebecame a genericsetDmsRule(id, rule, onDone)shared by both DMS-owned rules, with a process id per rule.Validation
dms config windowrules add hyprlandfromupstream/masterand this branch, run against a sandboxedXDG_CONFIG_HOMEhyprctl configerrorsempty, a rule change applies to new windows without a manual reload, a.*opacity rule dims other apps but not Settings, the slider dims other apps and 100 restores the user's values, and the opaque rule comes back after deleting it from the file and restartingrounding/border_sizeround trip, opaque rule kept last on set/remove/reorder, and end-to-end write → reorder → reload for Hyprland and nirigo test ./...(everything exceptinternal/screenshot'sTestWaylandOutputBoundsScaled, which also fails onupstream/masteron this machine),GOOS=freebsd go build ./...,make lint-qml,make build,python3 quickshell/tests/run-qml.py logic qt lock, settings search index regenerated,prek runon the changed files. Skipped theqml-testshook (needs niri) and thego-testhook (the screenshot test above)Type of change
Related issues
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings