-
-
Notifications
You must be signed in to change notification settings - Fork 69
Change end of trimmed long window titles to U+2026 #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
14f0ceb to
290c3da
Compare
Agent side should have replaced the end of very long window titles to U+2026 (Horizontal Ellipsis). But the Daemon side might have been configured to disallow UTF8 characters. Replace that character with ... Supplements: QubesOS/qubes-gui-agent-linux#227 Main issue: QubesOS/qubes-issues#5986
290c3da to
ad0798e
Compare
. . .|
as said on matrix, this could use an integration test (in core-admin) |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061118-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061004-4.3&flavor=update
Failed tests30 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/142375#dependencies 10 fixed
Unstable testsPerformance TestsPerformance degradation:6 performance degradations
Remaining performance tests:66 tests
|
gui-agent/vmside.c
Outdated
| // Trim at correct utf8 boundary and set end to U+2026 (Horizontal Ellipsis) | ||
| msg.data[sizeof(msg.data) - 4] = 0; | ||
| for (int i=0; i < 4; i++) { | ||
| uint8_t * last_byte = (uint8_t *)msg.data + strlen(msg.data) - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid calling strlen over and over by simply using loop iterator here:
| uint8_t * last_byte = (uint8_t *)msg.data + strlen(msg.data) - 1; | |
| uint8_t * last_byte = (uint8_t *)msg.data + sizeof(msg.data) - 5 - i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done. But I have not tested it (only checked if this compiles). Could I make a PR to make custom gui daemon/agent per domain possible (via two features)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The important part of this suggestion was to replace strlen with sizeof...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with sizeof...
gui-agent/vmside.c
Outdated
| break; | ||
| } else { | ||
| // trim one invalid byte at end of string | ||
| msg.data[strlen(msg.data) - 1] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here you can avoid re-calculation by using last_byte:
| msg.data[strlen(msg.data) - 1] = 0; | |
| *last_byte = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also done
|
ad0798e to
c4f6e37
Compare
If the window title is very long and trimmed, then replace the end of it with U+2026 (Horizontal Ellipsis) to let user know about it. fixes: QubesOS/qubes-issues#5986 related: QubesOS/qubes-gui-daemon#155
c4f6e37 to
474efd5
Compare
If the window title is very long and trimmed, then replace the end of it
with U+2026 (Horizontal Ellipsis) to let user know about it.
fixes: QubesOS/qubes-issues#5986
related: QubesOS/qubes-gui-daemon#155