Xfce Forum

Sub domains
 

You are not logged in.

#1 2010-01-24 06:02:49

gnome_refugee
Member
Registered: 2010-01-15
Posts: 169

Where are desktop icon positions specified?

When I save something to Desktop in any application, or when Thunar notices that I've put something into my optical drive, the icon appears at top left on the desktop. Additional icons seem to be added relative to that first one.

This positioning of icons doesn't seem to be affected by where I set window margins (in Settings>Workspaces>Margins) or whether or not I have left-vertical panels.

I'd prefer to have first and subsequent icons appear more towards the middle of the desktop, but I haven't yet found where the icon position info is specified.

Suggestions welcome! (I'm using Xfce 4.6.1 in Xubuntu 9.10.)

Offline

#2 2010-01-24 09:04:46

haarp
Member
Registered: 2010-01-17
Posts: 10

Re: Where are desktop icon positions specified?

~/.config/xfce4/desktop/icons.screen0.rc

Offline

#3 2010-01-24 09:52:58

gnome_refugee
Member
Registered: 2010-01-15
Posts: 169

Re: Where are desktop icon positions specified?

Hi, haarp.

That file is written when the icons are generated. For example, here's that file (~/.config/xfce4/desktop/icons.screen0.rc) after today's login:

[20100123_rsync.log]
row=1
col=0

[250G Volume]
row=0
col=0

It tells me where the icons were placed, but by what?

when I plugged in the 250G external HDD and rsync'ed to it.

Offline

#4 2010-01-24 10:14:44

gnome_refugee
Member
Registered: 2010-01-15
Posts: 169

Re: Where are desktop icon positions specified?

I wonder if this is hard-coded in xfdesktop. If I increase the desktop icon size (Settings>Desktop>Icons) from the default 24 px to something like 96, the icons shift to the right, leaving "panel-room" on the left side of the screen. A 256 px icon shifts even more. Seems to be a rule relating icon size and position, which would be hard for the Xfce developers to offer as configurable.

Anyway, I can live with huge icons, as I normally keep the desktop clear and the files/drives are only there temporarily.

Offline

#5 2010-01-24 19:13:39

herd
Member
From: Germany
Registered: 2006-05-18
Posts: 143
Website

Re: Where are desktop icon positions specified?

No. As can be seen above, icons are positioned with row/column coordinates.
If you change the size of each cell, the coordinates remain the same but the grid gets enlarged.

Offline

#6 2010-01-24 21:27:51

gnome_refugee
Member
Registered: 2010-01-15
Posts: 169

Re: Where are desktop icon positions specified?

Hi, herd.

You're right about that, and what I was assuming was that implied rule (somewhere in the code) puts the first icon at row 0, col 0. My hope was that I could find a configurable file where I could change that to (say) col 3.

My wife and I came up with a really ugly workaround which I haven't tried yet. If you like elegance and cool hacking, please don't read any further.

The trick would be to fill the first couple of 24 px columns with invisible icons, so that the next visible icon appears in col 3. The invisibles would be visible at first, say Launchers with their default icon, so you could see where they were being positioned. When they had filled the space you want left blank on the desktop, you would swap the icons for a homemade blank png, and make the Name text invisible with a non-printing character.

Offline

#7 2010-01-24 22:33:30

herd
Member
From: Germany
Registered: 2006-05-18
Posts: 143
Website

Re: Where are desktop icon positions specified?

Reading the xfdesktop4 sources, you are right. There is no special handling for remembering pluggable drive icon positions.
The algorithm is as follows:

static gboolean
xfdesktop_grid_get_next_free_position(XfdesktopIconView *icon_view, guint16 *row, guint16 *col)
{
    gint i, maxi;
    g_return_val_if_fail(row && col, FALSE);
    
    maxi = icon_view->priv->nrows * icon_view->priv->ncols;
    for(i = 0; i < maxi; ++i) {
        if(!icon_view->priv->grid_layout[i]) {
            *row = i % icon_view->priv->nrows;
            *col = i / icon_view->priv->nrows;
            return TRUE;
        }
    }
    return FALSE;
}

So it will simply start from 0/0, fill down until column 0 is consumed and continue populating with column 1.
If there are empty places in this sequence, it will use them; so your workaround seems succinct.

But I would rather file a bug report requesting the pluggable drive positions to be remembered.

hth,

herd

Offline

#8 2010-01-24 22:50:06

haarp
Member
Registered: 2010-01-17
Posts: 10

Re: Where are desktop icon positions specified?

Maybe it would be wise to add an option that allows saving icon positions even when icons are deleted

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 544.34 KiB (Peak: 544.96 KiB) ]