Have two files named "loremipsum" and "loremipsum loremipsum" in icon view. First one is displayed as a one-line, second one is divided to two lines.
the clickable area of the two line filename is wider than the blue area drawn when it is selected - see the attached picture (excess area in red).
So sometimes "clicking empty space" selects a file. This also affects rubberband selection - the file becomes selected even if it is not yet inside the rubberband.
As soon as the filename is more than one line, the width of the "active" (clickable, selectable) area of the filename is always some predefined maximal width.
Attachment 9140, "excess-clickable-area.png":
Version: 0.12.8
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Video demonstrating the bug. The rubberband selects "loremipsum loremipsum" even if it is not yet inside it.
Then shown: clicking outside "loremipsum loremipsum" selects the file.
I think a related bug occurs when using Edit/Preferences/Display/Text beside icons - multiline filenames are not displayed right next to the icon, there can be a visual (yet clickable) gap between the icon and the multi-line filename (see the above screenshot).
Delving into the code, there is exo_icon_view_calculate_item_size(..) function, which contains a call to gtk_cell_renderer_get_preferred_size (..) (introduced with GTK 3). This call will, for the text cell, return the width as wrap-width (132 pixels=128+4 padding (in default zoom)) whenever the text is long enough to be multi-line. It will not return the real width of the wrapped multiline text. This is the origin of the excess clickable area. I do not know how to fix this at the moment.
exo_icon_view_paint_item (..) contains a call to gtk_cell_renderer_get_aligned_area (..), which will return the aligned_area as a area just around the rendered text, centered in cell_area (that is the reason why the highlight is painted correctly around the text, yet misplaced).
Sean, could you please revert the patch? It led to bug 16196. I consider the patch ugly, it is not a good piece of code. I do not have a better fix now, I feel the problem is at least partly in gtk3 (see remarks above) - I may be wrong with that feeling. Anyway, for the moment being, please do revert the change.
@lastonestanding no patch this time but my investigation could be useful: the problem seems to be GtkCellRendererText reporting a minimal width larger than the actual cell width, looking at gtk code I noticed that wrap_width is what "inflates" the width calculation, Thunar sets it depending on the selected zoom level, in my case it was zoom level 75% so the cell's min width was 116 (wrap_width=112 + xpad=2 * 2). This bug is not visible when using zoom level <= 50%.
I still don't understand why the cell width is clamped to a size smaller its minimal width.
One more thing, I can reproduce this bug with Thunar 1.6.17, the only difference is that icons with single line text are also selected before rubberband "touches" its text cell.
Thanks for looking into this. I do not really understand the involved code parts either, so I wonder what your opinion on the existing patch is? Too hacky? Added overhead?
@lastonestanding do you mean 6fcefce9 + icon_view->priv->orientation != GTK_ORIENTATION_HORIZONTAL? I don't know, playing with the code of that commit, I just removed the padding it adds and got good results, see this patch.
I couldn't find evidence in its code but it's like gtk_cell_renderer_get_aligned_area (gtk_cell_renderer_text_get_aligned_area -> get_size)
already takes padding into account.