Folders file diff comparison's notebook tab label not ellipsized, causing window width to expand with long filenames and prevents shrinking
I found a corner case where Meld 3.22.0's minimum window width can still blow up, on Fedora 38. I suspect it's not already fixed in the development version, as this is very specific and not mentioned in #608 (closed) : if you compare two files with very long names in very long path names in the context of a "two directories" comparison, the notebook's label will blow up the window width.
To test, create some humongously long folder path, and long filenames. For example, the files I'm comparing are:
/tmp/virtual-mail-import-comparison/frank maildir import 1 before patching/Maildir/.Drafts/cur/1689027159.M802265P129369.someserver.somedomain.com,S=4867,W=4969:2,DS
and
/tmp/virtual-mail-import-comparison/frank maildir import 2 after patching/Maildir/.Drafts/cur/1689027159.M802265P129369.someserver.somedomain.com,S=4867,W=4969:2,DS
The folder's diff view is correctly shrinkable:
...but as soon as you click those files to compare them, the window expands to this size, and cannot be shrunk:
I launched the GTK Inspector, grabbed that notebook tab's label widget:
...and as soon as I replaced its "label" property by a shorter thing like "Foo", or the "ellipsize" property to PANGO_ELLIPSIZE_START
(or middle, if you think that's better), the window's width could shrink again.
I wanted to throw a trivial patch / MR at this but I was blocked:
- I tried grepping through the code and found
notebook-label.ui
that could use<property name="ellipsize">start</property>
or<property name="text-overflow">ellipsize-end</property>
but I couldn't find that .ui file on my installed system (only in the dev repository) so I can't live-patch my system to test... and GNOME Builder can't launch meld by itself, because "bwrap: execvp meld: No such file or directory", so I can't try that one - I found your existing
child.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
code inlabel_changed_cb
in pathlabel.py, which is present in both the dev version and on my system, and I'm wondering why it somehow doesn't fix the issue I see here
At this point I suspect you'll be able to fix this yourself much faster anyway :)