QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
543 stars 48 forks source link

Titles/captions of all Windows are truncated (cut, croped, limited) after 128 chars #5986

Open jamke opened 4 years ago

jamke commented 4 years ago

Qubes OS version R4.0.

Affected component(s) or functionality Titles/captions of all windows.

Brief summary If the window has title longer than 128 chars (not including [appvm] at the beginning) then it gets truncated. Utf8 titles are allowed (allow_utf8_titles = true;) in guid.conf of dom0.

To Reproduce

  1. Open text editor in any appvm (at least one with allow_utf8_titles = true), e.g. Kate application.
  2. Save current file as "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789.txt"

Expected behavior The title of the window should be: "[appvm] 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789.txt Kate" Expected title of the window should not be truncated or at least truncated after 1024-4096 chars/symbols or something like that so it will not annoy users and be visible everywhere.

Actual behavior The title of the window is "[appvm] 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567", so the rest gets truncated.

Additional context Utf8 titles are allowed (allow_utf8_titles = true;) in guid.conf of dom0. Expected title of the window should not be truncated or at least truncated after 1024-4096 chars/symbols or something like that so it will not be visible on usual 2K/4K monitors.

Solutions you've tried None that I know about.

Related, non-duplicate issues I'm surprised I did not find duplicates or similar issues because I have this problem for ages and probably everyone has it on any 20+ inch monitor in web browser when page's name get truncated like that on half of the pages. So, I probably just missed those issues.

jamke commented 4 years ago

I hope someone will tell if they have or don't have the same issue for example on this page in Firefox (with allow_utf8_titles in global section of guid.conf in dom0), because the title of this page is already long enough. I have it like that: [myappvm] Titles/captions of all Windows are truncated (cut, croped, limited) after 128 chars · Issue #5986 · QubesOS/qubes-issues - Mo. So, Mozilla Firefox was cut off.

marmarek commented 4 years ago

Yes, it seems indeed window title is limited to 128 chars by qubes gui protocol. And yes, this window has it truncated for me too. But to notice it, in fact I needed to make the window wider, because otherwise it was truncated at "M" by the end of the title bar...

Since no one else has noticed it before, I guess this is pretty minor issue.

jamke commented 4 years ago

Yes, the issue is not affecting work but it's kind of ugly for everyone who has 4k or even so-called 2k monitor (probably not laptop).

So, I suggest it to be fixed if changing qubes gui protocol is as easy as char data[4096];. Maybe it's not that easy, I don't know.

By the way, 128 in code is a magic number that adds smell. Better to make something like #define MAX_WINDOW_TITLE_LENGTH (4096) and use char data[MAX_WINDOW_TITLE_LENGTH]; as this length might be required in different places of project.

jamke commented 2 years ago

The issue still exists in R4.1.1, so, maybe milestone should be updated.

alimirjamali commented 3 weeks ago

This is easy but would require GUI protocol bump for both Daemon and Agent. I guess a patch could be made but not merged until we have something highly meaningful and high priority for a protocol bump. Also affects 4.2 & 4.3

define MAX_WINDOW_TITLE_LENGTH (4096)

Development notes: On a 8K monitor with the width of 7680 pixels, each character should be at least 8 pixel width to be readable. So the maximum could be 960 characters (or 1024). Unless user has 4x 8K monitors side-by-side. Maybe it is not the case at the moment without GPU acceleration, but might be useful in future. So the suggested 4096 characters sounds reasonable. It appears that the maximum supported resolution by X Window might be 16384 x 16384 pixels. So a 4x 8K monitor setup is not possible.

p.s.: For both new and old protocol, if the title is longer than the limit, changing the last three characters to ... is desirable.

jamke commented 2 weeks ago

@alimirjamali thank you for picking up and solving such long-standing issues.