Repository navigation
Allow disabling and re-enabling displays from the monitor panel - #22021
Open
Darkiu1337 wants to merge 2 commits into
Open
Darkiu1337 wants to merge 2 commits into
Darkiu1337 wants to merge 2 commits into
Conversation
Author
Contributor
Confidence Score: 4/5
[Medium impact] The changes affect display controls for users of the monitor panel. Hold merging until queued disables are shown to preserve the last active display. Findings
Fix with agent prompt### Issue 1
shell/plugins/panels/monitor/Panel.qml:563-570
With two external displays active, disabling one and then the other before the state read finishes lets both calls see `segments.length > 1`. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.
Recheck the active outputs when each disable runs instead of trusting the earlier panel state.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR adds display controls to the monitor panel.
Reviews (2) · Last reviewed commit: "Recheck active outputs on disable and su..." · Reviewed by Greptile |
Comment on lines
+563
to
+570
| if (!isSafeMonitorName(name) || segments.length <= 1) return | ||
| if (/^(eDP|LVDS|DSI)-/.test(name)) { | ||
| if (mirrorEnabled && mirrorManaged) { | ||
| runAction(["omarchy-hyprland-monitor-internal-mirror", "off"]) | ||
| } | ||
| runAction(["omarchy-hyprland-monitor-internal", "off"]) | ||
| } else { | ||
| runAction(["hyprctl", "eval", "hl.monitor({ output = \"" + name + "\", disabled = true })"]) |
Contributor
There was a problem hiding this comment.
With two external displays active, disabling one and then the other before the state read finishes lets both calls see segments.length > 1. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.
Recheck the active outputs when each disable runs instead of trusting the earlier panel state.
Prompt To Fix With AI
This is a comment left during a code review.
Path: shell/plugins/panels/monitor/Panel.qml
Line: 563-570
Comment:
**Both screens can turn off**
With two external displays active, disabling one and then the other before the state read finishes lets both calls see `segments.length > 1`. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.
Recheck the active outputs when each disable runs instead of trusting the earlier panel state.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
r) context menu inomarchy.monitor, guarded so the last active display can never be disabled.omarchy-hyprland-monitor-internal offfor built-in displays (preserving clamshell/unplug recovery, and turning off managed mirroring first if active) andhyprctl evalfor external displays.<output> · disabledchips below the layout map so any disabled display can be re-enabled in one click (restoring savedmonitor_settings).monitor.disable,monitor.disabledTag,monitor.enableDisplay) todefault/i18n/en/shell.json.Testing
bash test/shell.d/monitor-test.shbash test/shell.d/i18n-test.shbash test/shell.d/monitor-state-test.shbash test/shell.d/monitor-output-name-test.sh