! 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 !
Desktop icon grid does not resize appropriately to monitor resolution
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Greg Fleury 2011-04-17 01:06:47 CEST
Created attachment 3618 
See the visual

I currently have two screens:

screen 1 (left) is 2560x1440
screen 2 (right) is 1680x1050

The desktop icon grid that is generated based on my monitor size and selected icon size (currently using 72px) is too small for my monitor(s). Meaning, I am only able to place icons on roughly 3/4 of my screen. The grid should either be explicitly configuratable in Settigs -> Desktop -> Icons, or should at least, resize with the monitor resolution.
Comment 1 alexxcons editbugs 2019-05-02 10:57:40 CEST
Thanks for reporting and sorry for the very late reply !

Found out that the method "xfdesktop_grid_is_free_position" is to blame. Specially the last line:
return !icon_view->priv->grid_layout[col * icon_view->priv->nrows + row];

Which either returns 0, or some random garbage(uninitialized memory?). Here some logged output:

[1556786705466]: xfdesktop_grid_is_free_position - row: 2, col: 20, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786705466]: xfdesktop_grid_is_free_position - strange check: -559038737
[1556786705507]: xfdesktop_grid_is_free_position - row: 2, col: 19, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786705507]: xfdesktop_grid_is_free_position - strange check: -559038737
[1556786705557]: xfdesktop_grid_is_free_position - row: 0, col: 4, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786705558]: xfdesktop_grid_is_free_position - strange check: 0
[1556786706213]: xfdesktop_grid_is_free_position - row: 5, col: 0, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786706213]: xfdesktop_grid_is_free_position - strange check: 0
[1556786706218]: xfdesktop_grid_is_free_position - row: 1, col: 28, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786706226]: xfdesktop_grid_is_free_position - strange check: -559038737
[1556786706228]: xfdesktop_grid_is_free_position - row: 6, col: 0, icon_view->priv->nrows: 10, icon_view->priv->ncols: 37 
[1556786706230]: xfdesktop_grid_is_free_position - strange check: 0

After fixing "xfdesktop_grid_is_free_position" with just returning TRUE after the first check, the icons are loaded correctly, but somehow "locked" ... like described in this bug:
https://bugzilla.xfce.org/show_bug.cgi?id=13873

I will further investigate and hopefully have a fix for both bugs soon.
Comment 2 alexxcons editbugs 2019-05-05 00:21:40 CEST
Created attachment 8488 
patch for master

ok, finally I found the real cause.

There is a method "xfdesktop_icon_view_setup_grids_xinerama" which checks if an icon is inside the monitor boundary, and deletes them from the list, if they are out of bound.
This method seems to be wrong in two aspects:
1. Icons positions in the grid are not stored relative to a monitor boundary. They are stored relative to the complete workarea, which may span multiple monitors.
2. There seems to be some miscalculation inside the method. Even if an icon is inside the boundary, the method deletes it, resulting in a grid which is to small.

I dont think it is necesarry at all to delete out of bound items, since actually out of bound items are not added to the desktop in the first place. This already works fine ... so IMO fine to drop "xfdesktop_icon_view_setup_grids_xinerama" and it's submethods.
Comment 3 alexxcons editbugs 2019-05-05 00:22:15 CEST
Created attachment 8489 
patch for 4.12 branch
Comment 4 alexxcons editbugs 2019-05-05 00:25:43 CEST
*** Bug 13873 has been marked as a duplicate of this bug. ***
Comment 5 alexxcons editbugs 2019-05-06 10:13:12 CEST
Meh, I found out that I am partly wrong. Where my patch for 4.12 realy fixes the problem, for master I cannot reproduce the problem itself.
So it looks like some other commit meanwhile fixed the problem for master .. I will further test/bisect and search which commit fixed it for master.
 
(In reply to alexxcons from comment #2)
> ok, finally I found the real cause.
> 
> There is a method "xfdesktop_icon_view_setup_grids_xinerama" which checks if
> an icon is inside the monitor boundary, and deletes them from the list, if
> they are out of bound.
> This method seems to be wrong in two aspects:
> 1. Icons positions in the grid are not stored relative to a monitor
> boundary. They are stored relative to the complete workarea, which may span
> multiple monitors.
Still not sure why the code works for master ... have to further test this method, since the calculation looks suspicious.

> I dont think it is necesarry at all to delete out of bound items, since
> actually out of bound items are not added to the desktop in the first place.
> This already works fine ... so IMO fine to drop
> "xfdesktop_icon_view_setup_grids_xinerama" and it's submethods.
A use-case for "xfdesktop_icon_view_setup_grids_xinerama" could be, if a new monitor is plugged while the computer is off. Via the "latest" symlink this could trigger the load of a grid which does not match the monitor bounderies any more.

... I will come up with a better patch soon (or possibly just a cherry-pick from master)
Comment 6 alexxcons editbugs 2019-05-11 00:05:39 CEST
Ok, looks like this bug got fixed on master by moving to gtk3 by commits ec0d9e9f7022ff1145ff27508693baaaec93b9e2 and 13ca675d2713b2da63c6869d0eb4d71a039a5393.
( By using GdkDisplay instead of GdkScreen for different calls)

I cannot apply these commits to the 4.12 branch, since they rely on methods, only available in gtk 3.22.
And I dont want to remove xfdesktop_icon_view_setup_grids_xinerama completly, like described above.

So there will be no fix for the 4.12 branch, however master does not suffer from the bug any more.

Bug #7508

Reported by:
Greg Fleury
Reported on: 2011-04-17
Last modified on: 2019-05-11
Duplicates (1):
  • 13873 xfdesktop doesn't save the arrangement of desktop icons and locks after reboot

People

Assignee:
alexxcons
CC List:
5 users

Version

Attachments

See the visual (45.39 KB, image/png)
2011-04-17 01:06 CEST , Greg Fleury
no flags
patch for master (3.81 KB, patch)
2019-05-05 00:21 CEST , alexxcons
no flags
patch for 4.12 branch (3.85 KB, patch)
2019-05-05 00:22 CEST , alexxcons
no flags

Additional information