After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736792 - Path bar buttons can force nautilus windows to be too wide
Path bar buttons can force nautilus windows to be too wide
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: Path Bar
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-17 11:37 UTC by Allan Day
Modified: 2021-06-18 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (44.70 KB, image/png)
2014-09-17 11:37 UTC, Allan Day
  Details
nautilus-pathbar: Allow label shrinking (18.55 KB, patch)
2014-09-23 15:53 UTC, Carlos Soriano
rejected Details | Review

Description Allan Day 2014-09-17 11:37:03 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.
Comment 1 Víctor Cuadrado 2014-09-17 11:40:22 UTC
This happens to me on a 1280x800 screen. It didn't happen with Nautilus 3.8 on Gnome-Shell 3.8.
Comment 2 Allan Day 2014-09-17 13:12:00 UTC
(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.
Comment 3 Carlos Soriano 2014-09-23 15:53:13 UTC
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.
Comment 4 Carlos Soriano 2014-09-23 16:00:14 UTC
(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.
Comment 5 Víctor Cuadrado 2015-07-10 16:15:26 UTC
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
Comment 6 Carlos Soriano 2016-03-01 19:14:32 UTC
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
Comment 7 António Fernandes 2017-08-17 22:10:34 UTC
Review of attachment 286890 [details] [review]:

Actually marking as rejected, as per comment 6
Comment 8 André Klapper 2021-06-18 15:52:33 UTC
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.