GNOME Bugzilla – Bug 736792
Path bar buttons can force nautilus windows to be too wide
Last modified: 2021-06-18 15:52:33 UTC
Created attachment 286360 [details] screenshot Directories with long names can force Nautilus windows to be too wide. This can then prevent a window from being snapped to half the display. This happens because path bar buttons don't dynamically adjust their width according to the available space, and instead have a fixed minimum width which is actually quite wide. See the attached screenshot for an example.
This happens to me on a 1280x800 screen. It didn't happen with Nautilus 3.8 on Gnome-Shell 3.8.
(In reply to comment #1) > This happens to me on a 1280x800 screen. It didn't happen with Nautilus 3.8 on > Gnome-Shell 3.8. I guess that's because 3.8 didn't have a header bar - so you didn't have window controls adding to the overall width of the window.
Created attachment 286890 [details] [review] nautilus-pathbar: Allow label shrinking Currently the labels of the pathbar set a required size based on its preferred size. That brings the problem that setting a minimum size of its preferred size doesn't allow to shrink the label when needed, e.g. when the windows need to be snapped to a side or when making the window smaller. To avoid that, implement a GObject that its preferred size its natural size, and minimum size of 0, allowing the label to shrink when necesary.
(In reply to comment #3) > Created an attachment (id=286890) [details] [review] > nautilus-pathbar: Allow label shrinking > > Currently the labels of the pathbar set a required size based on its > preferred size. That brings the problem that setting a minimum size of > its preferred size doesn't allow to shrink the label when needed, e.g. > when the windows need to be snapped to a side or when making the window > smaller. > To avoid that, implement a GObject that its preferred size its natural > size, and minimum size of 0, allowing the label to shrink when necesary. This is my first gtk/gobject no-one-line patch, so it probably have some oddities. On the technical side, I commented out some things that are necessary and previous code "tried" to do, but actually was doing nothing. Before this patch, we tried to get always the max size of the label between the bold and natural label, but the thing is that the label was never show, so the bold label request was always 0, and therefore doing nothing. I found that out later in the progress of this patch, so I don't really know how to solve it neither in my current patch. Although that was a bug before too it was mitigated for the set_size_request of the label that made it to only fail the first time. Any ideas? On the other hand, do I need to g_object_unref the labels on the finalize handler on nautilus_pathbar_button_label object? My logic say yes, but it segfault.
This bug has been fixed on Gedit 3.16.2 by allowing ellipsis on the document file name when it is snapped to the left or the right. Maybe that's the solution. This other Nautilus bug is related to this one: https://bugzilla.gnome.org/show_bug.cgi?id=739624
Review of attachment 286890 [details] [review]: I reject my own first patch to nautilus since we are going to do a new pathbar for 3.22
Review of attachment 286890 [details] [review]: Actually marking as rejected, as per comment 6
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.