Change end of trimmed long window titles to U+2026#227
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 testsDetailsPerformance TestsPerformance degradation:6 performance degradations
Remaining performance tests:66 tests
|
| // 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.
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.
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.
The important part of this suggestion was to replace strlen with sizeof...
There was a problem hiding this comment.
Replaced with sizeof...
| break; | ||
| } else { | ||
| // trim one invalid byte at end of string | ||
| msg.data[strlen(msg.data) - 1] = 0; |
There was a problem hiding this comment.
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.
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