I apologize if this was already fixed in newer versions.
In the past I think I noticed that rename dialog boxes did not adjust in width to show the full length of filenames.
This appears to now achieve this, but now I noticed that file extensions seem to get cut off by dialog input fields right edge.
At first I thought it might just be with extensions that contained more than three letters but that is not true, it happens with three letter extensions as well.
Not sure if anyone else experiences this?
Thank You
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
It seems that the width calculation is not perfect, so the filename is either cut off at the start (when the full name was selected) or end (file extension not selected anymore).
Increasing the "magic numbers" (to 12*5 + 60) helps up to a certain file name length... I'm running with 130 DPI, but using the default 96 does not help (depending on the length of the file name obviously), as doesn't changing the GTK theme (tried Adwaita and Yaru (both out of date, on Deb12)).
However, seems to me that either pango_layout_get_pixel_size is doing something weird with very long file names, or it's the gtk_editable_select_region...in relation with gtk_window_set_default_size which apparently fails if the file name is too long.
Except, increasing the dialog width with gtk_window_set_default_size (GTK_WINDOW (dialog), CLAMP (layout_width, 900, parent_width), -1); or just setting 3000 for the width instead of CLAMP and with short(ish) filenames makes the dialog quite wide as expected, however with very long file names, it apparently doesn't resize (expand) at all.
Instead, file extension gets completely cut off together with the dot.
Examples with the above change (default width increased significantly), using:
Also, slowly resizing the dialog from the 2nd screenshot^^ to increase it's width, first reveals the extension, then continues revealing the rest of the filename towards beginning, and vice-versa, reducing the width first hides the extension and then continues chopping the filename. Behaves the same regardless if text is selected, or not at all. Yet, if the extension or any part of the text is selected, it then tries to keep it visible on the right edge.
Looked briefly at libxfce4ui/xfce-filename-input.c and failed to note anything wrong/weird there, except maybe for "max-text-length", though I don't see that being set when rename dialog is being made from Thunar)??
Perhaps a GtkEntry issue/misbehavior/weirdness then?
Also, slowly resizing the dialog from the 2nd screenshot^^ to increase it's width, first reveals the extension, then continues revealing the rest of the filename towards beginning, and vice-versa, reducing the width first hides the extension and then continues chopping the filename. Behaves the same regardless if text is selected, or not at all. Yet, if the extension or any part of the text is selected, it then tries to keep it visible on the right edge.
...
Perhaps a GtkEntry issue/misbehavior/weirdness then?
Tried GtkEntry in Python, got the same exact behavior
Is the width calculation really necessary? The input field could just be fixed/relative width, for example 200px or 20% of screen width, whichever is greater. The reason is that even though the window can be resized to input text width, the text will change (since it's a rename function), resulting in a too wide or too narrow window anyway. It seems auto-resize doesn't help much in this case.
Also, the OP is specifically asking about "incomplete" text selection, not the window width calculation. Just to answer, @advice, it actually is complete, deliberate and by design. Most of the time users want to rename the file, but not the suffix. However, the functionality could be configurable.
I implemented a different width calculation in !512 (merged). It usually leaves some extra space, but keeps the code to not exceed the parent window width.
If the rename dialog is too narrow to fit the whole filename, GtkEntry will still manage the visibility of the selection by hiding the non selected part (file extension).