fix: unify resolution display format to use ASCII 'x'#639
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideStandardizes all displayed resolution strings to a consistent ASCII 'WxH' format without spaces or Unicode multiplication signs, and adjusts how current resolution with refresh rate is constructed from xrandr output. Flow diagram for resolution string normalization to ASCII WxHflowchart LR
A[Raw xrandr output line
e.g. 1920 x 1080] --> B[Regex capture
width x height groups]
B --> C[Remove spaces
1920x1080]
C --> D[Assign to minResolution
curResolution
maxResolution]
subgraph DeviceMonitor_current_resolution
E[Match resolution and refresh rate
e.g. 1920x1080 60.00] --> F[Compute curRate string]
F --> G[Build current_resolution_without_unicode
1920x1080@60.00]
end
subgraph ThreadExecXrandr_dbus_values
H[Read maxResolutionWidth
maxResolutionHeight
minResolutionWidth
minResolutionHeight] --> I[Format as %1x%2]
I --> J[Store maxResolution
minResolution as WxH]
end
D --> K[UI components display
resolutions as ASCII WxH]
G --> K
J --> K
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The formatting around the refresh rate is inconsistent:
m_CurrentResolution = match.captured(1) + "@" + curRate;vsmatch.captured(1) + " @" + curRate;— consider standardizing on one exactWxH@rateformat without spaces as described in the PR. - Resolution normalization logic (removing spaces, unifying
x, appending@rate) is spread across several call sites; consider extracting a small helper to format resolutions in one place so future changes to the display format stay consistent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The formatting around the refresh rate is inconsistent: `m_CurrentResolution = match.captured(1) + "@" + curRate;` vs `match.captured(1) + " @" + curRate;` — consider standardizing on one exact `WxH@rate` format without spaces as described in the PR.
- Resolution normalization logic (removing spaces, unifying `x`, appending `@rate`) is spread across several call sites; consider extracting a small helper to format resolutions in one place so future changes to the display format stay consistent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Remove Unicode multiplication sign replacement and extra spaces from resolution strings, standardizing to plain 'WxH' format across all display adapter resolution fields. 统一显示适配器分辨率格式,移除 Unicode 乘号和多余空格, 全部使用 ASCII 'x' 格式(如 1920x1080)。 Log: 统一分辨率显示格式为 ASCII x PMS: BUG-351831 Influence: 显示适配器的当前分辨率、最小分辨率、最大分辨率显示格式统一,不再出现格式不一致的情况。
lzwind
approved these changes
Apr 9, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, wyu71 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Remove Unicode multiplication sign replacement and extra spaces from resolution strings, standardizing to plain 'WxH' format across all display adapter resolution fields.
统一显示适配器分辨率格式,移除 Unicode 乘号和多余空格,
全部使用 ASCII 'x' 格式(如 1920x1080)。
Log: 统一分辨率显示格式为 ASCII x
PMS: BUG-351831
Influence: 显示适配器的当前分辨率、最小分辨率、最大分辨率显示格式统一,不再出现格式不一致的情况。
Summary by Sourcery
Standardize display adapter resolution strings to a consistent ASCII-based format.
Bug Fixes:
Enhancements: