! 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 !
Icons disappear from desktop when changing desktop settings
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Mikko Linnalo 2006-03-05 21:26:04 CET
Changing desktop settings while icons are shown on desktop (either
files/launchers or minimizes apps), makes icons disappear from desktop. Moving
other than desktop settings window (e.g. thunar window) makes them re-appear.
Increasing the icon size over 82 is an easy way to reproduce this. Happens with
several icon and text size combinations.

Reproducible: Always
Steps to Reproduce:
Comment 1 Brian J. Tarricone (not reading bugmail) 2006-03-10 08:23:07 CET
Can you provide any more information?  I'm unable to reproduce this.
Comment 2 Mikko Linnalo 2006-03-10 15:50:58 CET
- Desktop settings window is open so that desktop icons are also visible on
screen. I used File/launcher icons on desktop.
- Change icon size over 82
or
- lower the font size to 4, then increase it to 5

--> Desktop icons disappeared. They are shown again after moving any of the windows

Don't know if this is system specific or not, but here's my specs anyway: x86
Ubuntu 5.10 (Breezy) with SVN Xfce

Maybe icon theme has something to do with this, I used the latest Tango icon theme
Comment 3 Brian J. Tarricone (not reading bugmail) 2006-03-12 21:57:58 CET
*** Bug 1569 has been marked as a duplicate of this bug. ***
Comment 4 Jari Rahkonen 2006-05-02 09:08:11 CEST
I can confirm the bug. As mentioned, the easiest way to reproduce this is to enlarge the icons (using the spin buttons). When going over 82, the icons (starting from the bottom of the desktop) first become unresponsive and then disappear from the desktop. The icons come back if you move a window, but they don't respond to mouse clicks or hover until you make them smaller again. This bug doesn't seem to affect .desktop file icons for some reason.
Comment 5 Cody A.W. Somerville 2006-09-01 03:02:36 CEST
This bug has been reported downstream at https://launchpad.net/products/xfwm4/+bug/48924

Comment 6 Jani Monoses 2006-10-17 16:55:44 CEST
In line 1960 of src/xfdesktop-icon-view.c pix_area.x can become a very large int
because it is gint while the icon->priv->font_size filed involved in the computation is guint. When 
((CELL_SIZE - 2 * CELL_PADDING) - pix_area.width) should be -1 it is interpreted as a large guint. That overflow happens wstarting with icon_size 82 which is larger than 9*font_size which is 81.

and pix_area looks like this which causes a segfault in gtk.
 pix_area = {x = -2147483629, y = 241, width = 82, height = 82}

Comment 7 Brian J. Tarricone (not reading bugmail) 2006-10-17 18:01:44 CEST
(In reply to comment #6)
> In line 1960 of src/xfdesktop-icon-view.c pix_area.x can become a very large
> int
> because it is gint while the icon->priv->font_size filed involved in the
> computation is guint. When 
> ((CELL_SIZE - 2 * CELL_PADDING) - pix_area.width) should be -1 it is
> interpreted as a large guint. That overflow happens wstarting with icon_size 82
> which is larger than 9*font_size which is 81.
> 
> and pix_area looks like this which causes a segfault in gtk.
>  pix_area = {x = -2147483629, y = 241, width = 82, height = 82}

This really has nothing to do with priv->font_size being a guint.  pix_area.x is getting overflowed; I see that, but the problem looks more to be that this term:

((CELL_SIZE - 2 * CELL_PADDING) - pix_area.width)

is ending up being less than zero.  Actually, I don't even see why that matters (well, it matters, but it should make pix_area.x overflow LESS, not more).

Do you have a suggestion for a solution?  I've never been particularly happy with how CELL_SIZE is calculated: maybe something a bit more complicated?  Otherwise the short-term workaround will be to limit the font size to something MUCH lower.
Comment 8 Brian J. Tarricone (not reading bugmail) 2006-11-06 06:14:20 CET
Created attachment 850 
new cell sizing patch

Ok, here's a new calculation method that's actually somewhat simpler.  The cell size is simply 2.5x the icon size.  This means you can set a font size that's ridiculously large and do stupid things, but that's  your problem.

Note that if you make the icon size so large that some icons don't fit on the screen, they will be lost until you first decrease the icon size, and THEN hit F5 to refresh the desktop.  I don't really see a need to change this behavior, even if it is a bit broken.  Automatically refreshing the desktop every time the font size changes is a bit CPU and I/O intensive.

Anyway, the attached patch should apply against 4.4rc2 (the change is also in SVN).
Comment 9 Brian J. Tarricone (not reading bugmail) 2006-11-06 07:20:04 CET
Ok, I changed my mind (esp. since the old way was causing a memleak).  Now icons should reappear if you set the icon size down lower such that they fit on the desktop.  And no need to internally do a full refresh, either, so it's pretty snappy.
Comment 10 Brian J. Tarricone (not reading bugmail) 2006-11-06 07:22:10 CET
Created attachment 851 
complete fix patch - new cell size and icons reappear

This patch incorporates the changes in attachment #850 , as well as the final fix for this bug.  It should apply against 4.4rc2.  (Changes are also in SVN, of course.)
Comment 11 Brian J. Tarricone (not reading bugmail) 2006-11-06 07:42:02 CET
Created attachment 852 
updated full fix patch

Sorry guys, typo in the last patch.  Here's a new one.
Comment 12 Brian J. Tarricone (not reading bugmail) 2006-11-06 21:52:35 CET
Jani, adding CC as FYI in case you want to include this patch in the new Xubuntu package.  I think it's worth it, and it could use some testing (though it's relatively low-risk).
Comment 13 Brian J. Tarricone (not reading bugmail) 2006-12-30 11:16:28 CET
*** Bug 2691 has been marked as a duplicate of this bug. ***

Bug #1546

Reported by:
Mikko Linnalo
Reported on: 2006-03-05
Last modified on: 2009-07-14
Duplicates (2):
  • 1569 Resizing desktop file icons to something large (e.g. >= 74 pixels) makes them inaccessible
  • 2691 desktop icons behavior erratically when size is >= 82 pixels

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
5 users

Version

Attachments

new cell sizing patch (616 bytes, patch)
2006-11-06 06:14 CET , Brian J. Tarricone (not reading bugmail)
no flags
complete fix patch - new cell size and icons reappear (11.13 KB, patch)
2006-11-06 07:22 CET , Brian J. Tarricone (not reading bugmail)
no flags
updated full fix patch (11.13 KB, patch)
2006-11-06 07:42 CET , Brian J. Tarricone (not reading bugmail)
no flags

Additional information