Author Topic: Truncated fields in client (due to hidpi screen?)  (Read 193 times)

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Truncated fields in client (due to hidpi screen?)
« on: September 05, 2017, 04:54:24 pm »
When running confidantmail on my hidpi (3200x1800) screen/desktop the text in several of the fields is truncated due to font-sizing confusion. In the past I often used to have this problem, especially with GTK2, but for the past ~year, with a capable and sanely-configured desktop environment, and especially when using GTK3, I haven't had any problems, except for confidantmail (even though it uses python-wxgtk3.0, which I would have expected to behave).

I have attached a screenshot of the relevant part of the window (the rest of the window was fine, so I cropped it out). The headers "From", "Subject", "Date", and "To" were also squashed together and truncated initially, but I was able to drag the column-edges to resize them, and thankfully the client remembers the column-widths on restart. However, the mailbox-names, etc in the left panel can't be resized.

Mike

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #1 on: September 05, 2017, 08:46:40 pm »
What version of wxpython and wxwidgets do you have installed? What OS is this? Is it correct that you are on the current Debian unstable?

I will try to reproduce the problem and look for a workaround.

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #2 on: September 06, 2017, 01:11:20 pm »
What version of wxpython and wxwidgets do you have installed? What OS is this? Is it correct that you are on the current Debian unstable?

Relevant info below:

Dependencies as per debian-installer.bash:
  • python-wxgtk3.0 --> 3.0.2.0+dfsg-4
  • python-twisted --> 17.5.0-2
  • python-enchant --> 1.6.7-1
  • python-socks --> 1.6.5-1
  • python-cryptography --> 1.9-1

Other:
  • libwxgtk3.0-0v5 --> 3.0.3.1+dfsg-1
  • confidantmail --> 0.41-2

Environment:
  • OS: Debian GNU/Linux --> Sid (unstable)
  • DE: cinnamon --> 3.2.7-3 [with "User interface scaling" set to "Double (Hi-DPI)", under System Settings->Preferences->General]
  • Resolution --> 3200x1800

I will try to reproduce the problem and look for a workaround.

Thanks!

Mike

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #3 on: September 11, 2017, 05:52:09 pm »
I tried to run this in virtualbox but I cannot get a resolution higher than 1024x768.
This is going to take a while to reproduce. If upgrading Virtual Box doesn't sort it out, I will try again using a physical install on a flash drive.
« Last Edit: September 11, 2017, 07:03:20 pm by Mike »

Mike

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #4 on: September 12, 2017, 01:37:54 pm »
I upgraded Virtual Box, installed the guest extensons, and was able to get a resolution of 2048 x 1152 with Hi-DPI enabled. The text is rather huge, but I could get Virtual Box to scale it back down. CM actually looks more or less ok. Here is a full resolution screen shot. I am not seeing the extreme mangling you were getting.

This is a fresh install of Debian Squeeze 9.1.0 with Sid apt-get over it.
« Last Edit: September 12, 2017, 01:42:50 pm by Mike »

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #5 on: September 18, 2017, 06:45:27 pm »
Hi, sorry for the late reply.

I upgraded Virtual Box, installed the guest extensons, and was able to get a resolution of 2048 x 1152 with Hi-DPI enabled. The text is rather huge,

OK. Have in mind that whatever mangling you found at 2048px will be nearly 1.5 times as bad at 3200px...

but I could get Virtual Box to scale it back down.

Do you mean you got the Desktop Environment to scale the fonts? If you actually mean you got Virtualbox to scale it, I am not sure how that could apply on a non-virtualized system.

CM actually looks more or less ok. Here is a full resolution screen shot. I am not seeing the extreme mangling you were getting.

I also since played around with CM and found if I set Configuration -> User Interface -> {Message List Window Size, View Window Size, Edit Window Size, Address Book Window Size} all to Large, drag-resize the left-panel of the client to increase horizontal width by at least a factor of 2, and then mess with the Mail Categories arrow in that panel (double-click to to collapse it, then double-click to re-expand it), it then becomes usable. Obviously this is not a solution, but I've at least found a (clunky) way to get the client to a usable state until the issue is fixed. The problem appears to me to be that the left panel is hard-coded to open with a specific width (in pixels?), which causes initial rendering of of its text to get overlapped and messy with very-high-resolution (and compensatory highly-scaled fonts). That is just my quick guess though, I haven't looked into the code or anything.

Mike

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #6 on: September 18, 2017, 10:13:22 pm »
It sounds like the main thing I need to do, is retain the position of the vertical split, like I currently save the width of the columns in the message list. This is easy to do. That way, if you resized it once, it would stay fixed.

As far as the size of the windows, you can type in X and Y values for those in the configuration. Please figure out what are good values and I will add some larger options to the pull-down list.

Are you running source or deb package? I can get you a patch to test in the next couple of days, and then I will merge that with some other improvements I am working on to create version 0.42

Do you have a CM address?

Mike




rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #7 on: September 19, 2017, 02:37:21 am »
It sounds like the main thing I need to do, is retain the position of the vertical split, like I currently save the width of the columns in the message list. This is easy to do. That way, if you resized it once, it would stay fixed.

I agree, that is the main problem I struck, and most important to fix.

As far as the size of the windows, you can type in X and Y values for those in the configuration. Please figure out what are good values and I will add some larger options to the pull-down list.

I set the various window-sizes to "custom" and configured them all as 3072x1668 (which was really "my desktop size minus some multiple of 2^x", deducting slightly more vertically to allow for my main panel). That worked for me, but then again I am rare for having a so-called "retina screen" on a laptop, when many who have such high resolutions are on tablets, phones, smart-TVs, etc - which would all probably require very different dimensions than that. Another problem is that when I run CM, it shows me a tiny account-selection window which I have to maximize to read, then when I select the account for configuring it shows me a tiny configuration window which I have to maximize to read (and even then the entry-boxes are so small that e.g. the custom size boxes looked like this):
Code: [Select]
-------- ----   ----
|Custom| |10| X |76|
-------- ----   ----
then when I do "(save &) open" the main UI window is tiny and I have to maximize it to read (unless I have already configured its size).

I recommend defaulting the window-sizes (account-selection, configuration, as well as the various UI windows) to a calculated "most of the primary/current desktop" size, including the main UI when not explicitly custom-configured (because I am sure most people, like me, would run it at least a few times before wanting to dive into custom-configuration - but due to the unreadability, unlike me, many would give up on it at that point rather than opening a bug on the forum). From a UX perspective I think everyone but the power-users will get turned off by "requires custom-configuration before being useful", so usable defaults which "just work" are essential (as much as the old "basic usability without having to learn pages of information") to attract more than a niche crowd, which is the same problem gpg has in my opinion. I come from already using mutt with gpg for years (which initially took much longer to setup than it should, as you probably know), and I have adequate patience/curiosity to navigate such issues, but even I considered giving up on using CM because of that sinking feeling that I might get mired in it, and because having to resize multiple times and drag-resize columns before doing anything meaningful each time (even after a custom size has been configured for the main UI) gets annoying fast enough to lose interest before solving it. Given that CM is a pure-python application, and it is trivial using python-xlib - as you probably already know - to deduce the dimensions of the current desktop, it should be easy to use calculated defaults for the account-selection & configuration windows. I also recommend that the default size setting for the various UI windows should be a pre-selected "default" entry on the configuration drop-downs - before "small", "large", etc - which would do the same thing (calculate a reasonable default based on desktop-size). That would probably be adequate for most users and would avoid them even needing to look at configuring the window-sizes.

Are you running source or deb package? I can get you a patch to test in the next couple of days, and then I will merge that with some other improvements I am working on to create version 0.42

I used the deb package (0.41-2) but I can run a source package if you don't want the hassle of building a package just to send me for testing. Also, if you prefer to send me a source-deb I can build that locally (I created and maintained a few debian packages myself for $dayjob over the years, also tried to get one into debian-official at one point, but gave up after zero mentor-response from any DDs after a few years).

Do you have a CM address?

I do, but had set it up with an ECC key. I will setup a new vanilla one and send you a quick "hello" from there soon, so you know where to reply to. BTW: I see there is a source-release available as a zip file, but do you develop in a repo which is publicly available anywhere? It just occurred to me that for some of what I described above I probably could have prepared a (self-describing) pull-request faster than I was able to type a clear description - particularly if using git. Alternatively, do you have a read-only repo somewhere which we can post merge-requests against (here, or on a mailing-list, or even direct-mailing your CM address)?

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #8 on: September 19, 2017, 03:59:51 am »
...also, when composing a message, the "From, To, Subject" columns look like "rom, To, ject", and are not resizable.

Mike

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #9 on: September 19, 2017, 11:49:34 am »
It appears you reused an auth key in CM, so your GPG key did not post. I cleared the auth key on the servers; please re-post your GPG key. An auth key is tied to a GPG key id once the GPG key is posted.

Please CM me a screen shot of the full desktop showing this one:
it shows me a tiny account-selection window which I have to maximize to read, then when I select the account for configuring it shows me a tiny configuration window

which I have to maximize to read (and even then the entry-boxes are so small that e.g. the custom size boxes looked like this):


and a screenshot of this:
...also, when composing a message, the "From, To, Subject" columns look like "rom, To, ject", and are not resizable.

Things like the From,To,Subject and size of entry windows in the configuration are set by the Wx library and not under my direct control, although I could oversize the requested character size of the entry boxes I suppose. Wx 4.0 may fix this but I'm not going to use such early code. It looks like I need a Hi DPI mode that works around the limits of Wx.

Since I am the only one making changes, I am not using git or svn.

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #10 on: September 19, 2017, 01:41:27 pm »
It appears you reused an auth key in CM, so your GPG key did not post. I cleared the auth key on the servers; please re-post your GPG key. An auth key is tied to a GPG key id once the GPG key is posted.

OK thanks, will do.

Please CM me a screen shot of the full desktop showing this one:
it shows me a tiny account-selection window which I have to maximize to read, then when I select the account for configuring it shows me a tiny configuration window

which I have to maximize to read (and even then the entry-boxes are so small that e.g. the custom size boxes looked like this):


and a screenshot of this:
...also, when composing a message, the "From, To, Subject" columns look like "rom, To, ject", and are not resizable.

After heavy image-shrinking (for filesize) and scrub tool (for privacy), I will attach four screenshots (to following forum-posts, due to attachment size-limits per-post) of:
  • non-maximized account selection window
  • non-maximized configuration window
  • maximized configuration window, user interface tab
  • new-message window

Things like the From,To,Subject and size of entry windows in the configuration are set by the Wx library and not under my direct control, although I could oversize the requested character size of the entry boxes I suppose. Wx 4.0 may fix this but I'm not going to use such early code. It looks like I need a Hi DPI mode that works around the limits of Wx.

I remember a couple of years ago I had to do all sorts of messing around with environment-variables to get my (highly customized, but at the time GTK2-based) window-manager to not look ridiculous. This was particularly because at the time I had a single desktop spanning this 3200x1800 primary monitor and a 1920x1080 secondary monitor (so had to have double-scaling in the WM, and then downscaling on the secondary monitor, with extra voodoo for some fonts, and some wrapper scripts for some stubborn applications which still misbehaved). That is one of the reasons I eventually fell-back to using a standard Cinnamon desktop, because it was one of the few options at the time which supported hidpi sanely without being a time-sink. I mention it because a lot of these problems I've encountered with CM look very similar to what I was seeing back then so perhaps some of those links might be relevant. From a quick google I found these two links I remember referring to:

and just in case it turns out to be relevant, these were some of the things I had to mess around with:
  • $QT_AUTO_SCREEN_SCALE_FACTOR
  • $GDK_SCALE
  • $GDK_DPI_SCALE
  • xrandr --scale ...
  • gsettings set org.gnome.desktop.interface scaling-factor ...
  • custom gimp hidpi theme plugin
  • etc...

Since I am the only one making changes, I am not using git or svn.

OK, was worth checking though...

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #11 on: September 19, 2017, 01:48:46 pm »
screenshot 1/4

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #12 on: September 19, 2017, 01:50:45 pm »
screenshot 2/4

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #13 on: September 19, 2017, 01:51:38 pm »
screenshot 3/4

rowanthorpe

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Truncated fields in client (due to hidpi screen?)
« Reply #14 on: September 19, 2017, 01:52:42 pm »
screenshot 4/4