! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Unclickable gap between filename and icon in ExoIconView
Status:
RESOLVED: FIXED

Comments

Description Adam Purkrt 2019-10-13 17:09:01 CEST
Created attachment 9113 
clicking-dead-region.png

There is a two pixels dead region between icon and filename in icon view. See the attached picture (highlighted in red).

So basically "clicking the file" sometimes does nothing.

Steps to reproduce
1) open thunar in icon view
2) try to click the region between filename and the icon
Comment 1 alexxcons editbugs 2019-10-13 21:08:08 CEST
Thanks for reporting !

Possibly a theme-specific bug. I can reproduce it with greybird and Icon View selected .. I was not able to reproduce in compact view.

The widget providing the thunar-view is the "ExoIconView", so I will move the bug to Exo.
Comment 2 Adam Purkrt 2019-10-13 21:34:14 CEST
Compact view is ok. I doubt it is theme specific, I can reproduce it also with Highcontrast theme. Again 2 pixels.
Comment 3 Theo Linkspfeifer editbugs 2019-10-13 22:18:06 CEST
I am seeing this in Nemo also.
Comment 4 Adam Purkrt 2019-10-20 20:04:59 CEST
This bug is not new. Just tried xubuntu 18.04, i.e. xfce 4.12, and can reproduce it there - two pixel gap.
Comment 5 Adam Purkrt 2019-10-20 20:18:07 CEST
Delving into the code, there is a "spacing" variable in exo/exo-icon-view.c in struct _ExoIconViewPrivate

https://git.xfce.org/xfce/exo/tree/exo/exo-icon-view.c#n552

It is set to zero, afaict (in fact it seems uninitialized). If I increase its value
  icon_view->priv->spacing = 16;
in exo_icon_view_init(...), the gap increases. But I am unable to close the gap with spacing=0. The two pixels always remain.
Comment 6 Adam Purkrt 2019-10-20 21:44:30 CEST
Couple of remarks after discussion with Theo over irc:
- xfdesktop (icons on the desktop) does not suffer from this
- in Nautilus (gnome file manager) there is no such gap
- the gap does not depend on the zoom level - it is always 2 pixels
Comment 7 Adam Purkrt 2019-10-21 15:56:20 CEST
Created attachment 9137 
exo-patch.p

The following patch works for me. Visually, nothing changes - its pixel-to-pixel as before the patch. But functionally, the unclickable gap is gone. Also improves clicking horizontally - before the patch, the rightmost pixel of "example" label was unclickable.
Comment 8 Theo Linkspfeifer editbugs 2019-10-21 16:37:56 CEST
I can confirm that the patch works.
Comment 9 Adam Purkrt 2019-11-02 17:51:16 CET
After some more research, I now think my patch (attachment 9137 ) is not the right way how to remedy this. The cause of the gap is simply padding - it is set to 3 pixels in thunar/thunar-icon-view.c

  g_object_set (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->icon_renderer),
                "ypad", 3u,
                NULL);

https://git.xfce.org/xfce/thunar/tree/thunar/thunar-icon-view.c#n101

Change the "3u" to "0u", recompile thunar and voila - the gap is gone. This time, though, also visually. But I would be all for this change - I do not miss the three pixels, they do not scale with zoom level anyway and it would make the code less readable to make them clickable (imo).

If you are wondering why 3u leads to only 2 pixel unclickable gap (and it is really two pixels, not three), the reason lies in the function exo_icon_view_get_item_at_coords in exo/exo-icon-view.c. The inequalities there should be "<" instead of "<=". The extra "=" brings the extra pixel (I verified this experimentally).

https://git.xfce.org/xfce/exo/tree/exo/exo-icon-view.c#n4359
and also lines 4360, 4373, 4374
Comment 10 Adam Purkrt 2019-11-02 18:04:25 CET
Created attachment 9178 
0001-Remove-the-vertical-gap-between-icon-and-its-label.patch

The patch for thunar, bringing the gap to zero.
Comment 11 Git Bot editbugs 2019-11-02 22:44:01 CET
Adam Purkrt referenced this bugreport in commit f35be6fd1b138a70f0e4d5003df6539c9cdceed7

Remove the vertical gap between icon and its label (Bug #16041)

https://git.xfce.org/xfce/thunar/commit?id=f35be6fd1b138a70f0e4d5003df6539c9cdceed7
Comment 12 Git Bot editbugs 2019-11-02 22:45:36 CET
Adam Purkrt referenced this bugreport in commit a9a779d352ca85c5fa087175ecd593e78edf7b16

Remove the vertical gap between icon and its label (Bug #16041)

https://git.xfce.org/xfce/thunar/commit?id=a9a779d352ca85c5fa087175ecd593e78edf7b16
Comment 13 alexxcons editbugs 2019-11-02 22:48:45 CET
Looks reasonable to me, and as well seems to fix the bug, thanks alot !

Pushed to master and 4.14 branch.

Possibly worth to provide as well a fix for the wrong pixel in exo_icon_view_get_item_at_coords if it should matter somewhere ? (If so, I guess a new bug would be good)
Comment 14 Sean Davis editbugs 2019-11-03 23:33:14 CET
Should we also apply the exo patch, or is the thunar patch sufficient?
Comment 15 Adam Purkrt 2019-11-12 21:59:55 CET
Created attachment 9217 
no-visual-gap.png

Eh, my fix introduced ugliness when the icon is full size vertically (.pdf thumbnail for example). The visual gap is missing - see the attached file. More sophisticated fix is needed that would keep the visual gap - preferably not 3 pixels fixed, but scalable with zoom.
Comment 16 Theo Linkspfeifer editbugs 2020-03-08 20:05:03 CET
Adam, would setting the value to "1u" help (no unclickable gap still)?
Comment 17 Theo Linkspfeifer editbugs 2020-03-15 13:30:04 CET
Created attachment 9604 
patch
Comment 18 Git Bot editbugs 2020-03-16 22:33:34 CET
Theo Linkspfeifer referenced this bugreport in commit 743be8c2aae0f118624907920c9c0cfe37b61384

Increase vertical gap between icon and its label slightly (Bug #16041)

https://git.xfce.org/xfce/thunar/commit?id=743be8c2aae0f118624907920c9c0cfe37b61384
Comment 19 Git Bot editbugs 2020-03-16 22:34:15 CET
Theo Linkspfeifer referenced this bugreport in commit 7959c91613dc20c829e36ff14ec60ff901462d3c

Increase vertical gap between icon and its label slightly (Bug #16041)

https://git.xfce.org/xfce/thunar/commit?id=7959c91613dc20c829e36ff14ec60ff901462d3c
Comment 20 alexxcons editbugs 2020-03-16 22:36:01 CET
Works fine for me .. adds a minimal gap, and is still clickable. Well done, Theo !
Pushed to master and 4.14

Bug #16041

Reported by:
Adam Purkrt
Reported on: 2019-10-13
Last modified on: 2020-03-16

People

Assignee:
Xfce Bug Triage
CC List:
3 users

Version

Attachments

clicking-dead-region.png (48.75 KB, image/png)
2019-10-13 17:09 CEST , Adam Purkrt
no flags
exo-patch.p (1.52 KB, patch)
2019-10-21 15:56 CEST , Adam Purkrt
no flags
0001-Remove-the-vertical-gap-between-icon-and-its-label.patch (973 bytes, patch)
2019-11-02 18:04 CET , Adam Purkrt
no flags
no-visual-gap.png (46.46 KB, image/png)
2019-11-12 21:59 CET , Adam Purkrt
no flags
patch (851 bytes, patch)
2020-03-15 13:30 CET , Theo Linkspfeifer
no flags

Additional information