[4.11.8] Desktop icons rearrange on each login

Bug #1335492 reported by Thomas Schweikle on 2014-06-28
112
This bug affects 22 people
Affects Status Importance Assigned to Milestone
Xfce4 Desktop
Fix Released
High
xfdesktop4 (Ubuntu)
Undecided
Unassigned

Bug Description

xfce4 looses desktop icon positions from time to time. The new positions are stored. Changing them again does store them ONLY if you create an additional desktop icon. Deleting this icon WILL in all cases make xfce4 loose all icon positions again!

Two screenshots to show the situation.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: xfce4 (not installed)
Uname: Linux 3.14.9+ x86_64
NonfreeKernelModules: zfs zunicode zavl zcommon znvpair
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Jun 28 23:08:02 2014
InstallationDate: Installed on 2011-10-19 (983 days ago)
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: xfce4
UpgradeStatus: Upgraded to trusty on 2014-02-24 (123 days ago)

Thomas Schweikle (tps) wrote :
Thomas Schweikle (tps) wrote :
Thomas Schweikle (tps) wrote :

At least anoying.

affects: xfce4 (Ubuntu) → xfdesktop4 (Ubuntu)

This problem may be related to bug 1190990.

Desktop icons order resets if there is an equal number of icons in any two or more columns.
version 4.11.8-0ubuntu0.1

*** Bug 11194 has been marked as a duplicate of this bug. ***

Does this bug occurs on your desktop?

I've never encountered this (otherwise I'd happily fix it). Does it happen when:

- you stop and restart xfdesktop? (xfdesktop --quit; xfdesktop &)

- during a screen size change?

- during login?

Just trying to figure out when it happens for you. Thanks!

Hello! Sorry for delay. I've just tried all of enlisted items, but the icons are still OK. I've noticed that after this bug occurs - number of .rc files in /home/USER/.config/xfce4/desktop/ incresing with a bit different resolutions (First time I have counted 12 rc files). And this happens on two Xubuntu machines with magic number of icons (adding or removing the icon may represent bug every reboot or fix it)
Adding another panel - made the icons to fit in one row. Deleting this panel reverted changes in icon order (I think it is standart behavior)

Is there a way to make united .rc file for all resolutions?

Did you already test the latest version of xfdesktop4 (4.11.8)? If it does not fix your issue, please forward this bug to the upstream bug tracker and tell us the bug number or the link.

https://bugzilla.xfce.org/

Thomas Schweikle (tps) wrote :

Yes I've tested this version already. Same as before, except it sorts icons every startup, not only on occasion. I've attached what I have sorted them to, and what I have after logging off and on again.

Thomas Schweikle (tps) wrote :

Before logging off and on again

Thomas Schweikle (tps) wrote :

After logging off and on again

Thanks for your quick response. Did you file a report on the Xfce bug tracker? The current developer of xfdesktop rarely checks the launchpad reports.

Here's the rationale for the rc files:
The .rc files are how Xfdesktop sees the space left on the screen. Things like the xfce4-panel may reserve space and xfdesktop respects that. The overall idea is that if your monitor goes through a couple resolution changes when your PC starts up or if you decide to play a game then your desktop should return to its old layout when it goes back to that resolution. Same thing with multi-monitor changes; you can have different layouts when your laptop is docked. The downside is that Xfdesktop doesn’t know when an icon position change should invalidate the other saved resolutions so in that case icons may change positions but Xfdesktop tries to minimize those moves.

Is it just one icon that gets messed up or all of them do? It may be due to something changing that causes xfdesktop uses an older .rc file (different panels or something like it on the desktop).

(In reply to Eric Koegel from comment #6)
> Here's the rationale for the rc files:
> The .rc files are how Xfdesktop sees the space left on the screen. Things
> like the xfce4-panel may reserve space and xfdesktop respects that. The
> overall idea is that if your monitor goes through a couple resolution
> changes when your PC starts up or if you decide to play a game then your
> desktop should return to its old layout when it goes back to that
> resolution. Same thing with multi-monitor changes; you can have different
> layouts when your laptop is docked. The downside is that Xfdesktop doesn’t
> know when an icon position change should invalidate the other saved
> resolutions so in that case icons may change positions but Xfdesktop tries
> to minimize those moves.
>
> Is it just one icon that gets messed up or all of them do? It may be due to
> something changing that causes xfdesktop uses an older .rc file (different
> panels or something like it on the desktop).

All icons change their order. The locate in top left corner.

I have noticed that the order resets when I logout and login. Three times in row this happened. I will try to remove gnome settings daemon and gsettings data convert from autostart and keep watching over my problem

My computer created yet another file with such config "icons.screen0-1008x584.rc"

[/home/yanpas/Рабочий стол/Лекции.doc]
row=0
col=0

[44A8-6CC0]
row=0
col=0

[Корзина]
row=0
col=0

[/]
row=0
col=0

[/home/yanpas]
row=0
col=0

Hi,
Please, inspects your file /home/USER/.cache/session-***.

It happened to me, and seeing this file, i see that there are many programs which automatically run multiple times.

I suspect that when you save the session, multipes xfdesktop try to write the same file, creating problems.

But it's just a suspicion.

Eric,
I have to admit that also suspicious of my changes in the distribution of icons. This weekend I'll try to test with this change reverted..

Regards,
Matias.

Hi,

You think this also happens to you?.
 * https://bugzilla.xfce.org/show_bug.cgi?id=11188

If yes, the problem is that the desktop is starting with some theme, this implies a font size, etc etc, resulting in a grid size, and therefore, it can change the order of icons.
After a second, xfsettingsd set your preferred theme with different fonts, spaces, etc, resulting in the final grid size.

The icons were reorganized, but as the screen size is the same, never save a copy of the pocision icons. Only replacement it by new info.

YES! I've noticed that my shimmer-project theme sometimes doesn't have time to load. For example Transmission gets default GTK icon on autostart and only restarting it changes the icon to the theme icon. Maybe some elements start in default theme and lose their order. Even if it so the bug persists, but in another component maybe

PS Another example: I have Clementine and Thunderbird on autostart. If I logout and then log in - thes programs doesn't have my GTK theme. Clementine is ugly-grey and thunderbird fonts are weird

Ok,
In my tests, applying the patch to xfsettingd seems that fix the bug.

Whell, The xubuntu people should add the patch, but surely take time.
You dare to compiling xfce4-settings to test?.

I will try to compile and will be watching bug

Hello. I think you meant patch from bug 11188. But which of them? And how to change source code automaticly with these + and -
PS In previous comment I read it from mobile phone and misunderstood.

Hi,
The best (Easy) way is compile directly the git version.

> sudo apt-get install git
> sudo apt-get build-dep xfce4-setting
> git clone git://git.xfce.org/xfce/xfce4-settings
> cd xfce4-settings
> ./autogen.sh
NOTE: This command should be more complete, but for this test not worry so much.
> make

The next step would be: sudo make install, but recommend overwrite the executable.

> killall xfsettingsd
Note: Not worry by theme change, and maybe here you see changes in yours icons.
> sudo mv ./xfsettingsd/xfsettingsd /usr/bin/
> xfsettingsd &

And restart you desktop.. ;)

And where is the patch in these steps, that small file with + and - lines. Or this patch has been already applied to the project and I need only to compile newer version from source?

> Or this patch has been already applied to the project and I need only to compile newer version from source?

Yes. ;)
The patch was added two months ago,but not enough changes to make a new release of xfce4-settings.

Created attachment 5813
icon bug

(In reply to Matias De lellis from comment #18)
> > Or this patch has been already applied to the project and I need only to compile newer version from source?
>
> Yes. ;)
> The patch was added two months ago,but not enough changes to make a new
> release of xfce4-settings.

Hello! Desktop icons behave good, there were no any self-replacements. But I've found new bug with xfsettingsd, which is not fixed in github. Transmission non-theme icon. Screenshot is attached. When I start my computer - I get default ugly icon, only after restaring transmission app icon becomes normal

Created attachment 5814
Bug again

Oh no! Just after a comment bug reproduced again. All I did before was plaing GTA IV in resolution 1680x1050. Then I set my creen to my native resolution 1920x1080 (everything is still OK). Then I logged out and logged in - and icons are mixed.
Also on logging in my clementine player, which is loaded automaticly didn't fully catched gtk theme, it has weird and wrong Font.

Ohh.. Ok. :(

Yesterday also happened to me. I will continue investigating.

Regards.

Hi everyone,
Nothing new. Sorry.. I Cannot isolate it :S

I reverted all my changes (I was worried about these. haha).. and the bug is still there.. :S

Perhaps it is a old bug, and only we discovered it now.

Only one detail. I discovered that it occurs when I close a session with many open applications and the "Save session" option is activated.

And noticing that is a lot easier reproduce it when restart the machine instead just close and open the session. Not know what is the difference. :S

Eric,
Not think that is related, but researching a bit found a bug:

> https://github.com/xfce-mirror/xfdesktop/commit/cfe5a0ad88b84a23a4cd6d18a25635ec84cbaf68

In this commit you introduce a big mem leak. Is not noticeable due it's just when close the session. I doubt the necessity of the commit, but surely you have your reasons. ;)

Well, the problem is that xfdesktop_application_get() increases the references and you have to add a unref after use it.

The obvious problem is the mem leak. but not the most worrying

The major problem is that you're assuming that XfdesktopApplication may be NULL. If XfdesktopApplication already NULL (understood is already closed), when you call xfdesktop_application_get(), you're starting an entirely new desktop !!!!.

..and due the missing unref basically never close it. Ends up being killed by the session. (This last is just supposition. haha. =)

Any idea how to debug this?
For now I'll add some g_print to see the sequence on shutdown.

Regards,
Matias.

Thomas Schweikle (tps) wrote :

Found what is going on: Desktop-Directory and Desktop configuration files are read concurently. Since desktop icon positions are not read at first, read files in Desktop-Directory are sorted default (top-left -> down-left). At some point at least one icon position is found (reading is concurent!) and then resorted. This leads to an event writing out the "new" positions of the icons, overwriting everything with new values. Since some icon positions where read before the icons where placed, these remain intact. Other icons where read before the icon positions where known these are sorted by default.
Result: some icons keep there places, while others are sorted by default.
At least one icon may be recognized as "moved" the icon position file is overwritten with the icon positions known by now.

This is a race condition: reading config-files races against reading desktop directory. Normally, with no load reading config files wins. But if some background processes are started this isn't true any more -- directory reading is faster, than configuration file reading with the result of resorted desktop icons.

The system shall make sure not to place any icon until it has read all configuration files holding icon positions. After these are know it can continue placing icons.

Created attachment 5866
Versions of xfce-files.

While starting up icon positions are partially lost. Some icons stay where I put them, some get moved to default (top-left-down-left-sorting).

Hi,
Dup of https://bugzilla.xfce.org/show_bug.cgi?id=11266

Please, add launchpad info on these bug.

Regards.

Changed in xfdesktop:
importance: Unknown → Medium
status: Unknown → Confirmed

https://bugs.launchpad.net/ubuntu/+source/xfdesktop4/+bug/1335492

This bug seems to be a race condition: xfce config files and desktop directory are read in parallel.
At first no icon positions are known. The first icons are placed by default, from top-left down to bottom-left.
Then, since the config file reading is slightly faster, than desktop directory reading, some icon positions are known and these are placed as expected.
Sometimes reading an icon position and reading the accompanying file might overlap: first the file is read, then the icon is placed at default, but slightly later it is placed at the expected position. Don't know how this happens, but it results in an event "icon moved" forcing the all icons already placed to be written to config files, overwriting the config file and reading it in again. This leads to loosing all icon positions not read from desktop directory. When these are found they are placed by default: top-left to bottom-left.
At very last, when all files in Desktop are placed the config file is written again (since there where "new" icons).

Simple way to confirm what is going on: place your icons you'd like to have them, then:

chmod 0444 ${HOME}/.config/xfce4/desktop/icons.screen0-<hsize>x<vsize>.rc
chmod 0555 ${HOME}/.config/xfce4/desktop
chown -R root ${HOME}/.config/xfce4

then restart. Depending how many background apps you run, you might find your desktop resorted with all icons in default order: top-left to bottom-left, filling the screen from left to right.
Log off, then on again. This time (since the config file couldn't be written) the icons will be sorted as given in the config file. Why?
Simple: restarting the system requires to load all libraries your background apps need, logging off and on again these are loaded already. Result: the first time you start your desktop the race is open: it depends on who wins: sometimes its the part reading the config file, sometimes it the part reading the desktop directory.
In case of log off and on reading the config file is normally much faster than reading the directory, thus all icons are placed as expected, because there positions are known, as they are read from "Desktop".

Conclusion: making sure the config file is fully read *before* "Desktop" reading starts might solve the problem ...

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfdesktop4 (Ubuntu):
status: New → Confirmed

Nice to hear that reason has been found! Waiting for fix ^^

Hi,
Your description seems correct. Eric? Ping.. =)

The commit where the bug is introduced would be this: https://github.com/xfce-mirror/xfdesktop/commit/f8fc72957dda162d7d310831494a336da849a6c

Tomorrow I try reverting this commit.

Regards,
Thanks for all!.

Matias

summary: - xfce4 looses desktop icon positions from time to time
+ [4.11.8] Desktop icons rearrange on each login
Changed in xfdesktop:
importance: Medium → Unknown
status: Confirmed → Unknown

*** Bug 11462 has been marked as a duplicate of this bug. ***

megaus (megaus) wrote :

xfdesktop 4.11.6-1ubuntu1 (trusty) do not have this issue
xfdesktop 4.11.8-0ubuntu0.1 (trusty-updates) has this issue

Changed in xfdesktop:
importance: Unknown → High
status: Unknown → Confirmed
Argyle (kruegejj) wrote :

I work around this problem (crudely) with a script and an autostart entry:

In ~/.config/autostart, place a file "fixicons.desktop" containing (something like):

[Desktop Entry]
Type=Application
Name=FixIcons
Comment=Workaround bug 1335492
Exec=~/bin/fixicons
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

And create the file "fixicons" in ~/bin, containing:

#!/bin/bash
# YMMV!
mkdir ~/iconTemp
cp ~/.config/xfce4/desktop/*.rc ~/iconTemp
sleep 20
cp ~/iconTemp/*.rc ~/.config/xfce4/desktop
# xfdesktop --restart - This doesn't work. Just press F5 with the desktop in focus.

Press F5 with the desktop in focus, and your icons should return to their regularly scheduled places. This works on startup / login, but doesn't work for situations where a full-screen application crashes and causes a logout.

Argyle (kruegejj) wrote :

Oops, note the "Exec" line above must be a full path. Apparently ~ completion doesn't take place here.

*** Bug 11499 has been marked as a duplicate of this bug. ***

(In reply to Matias De lellis from comment #26)
> Hi,
> Your description seems correct. Eric? Ping.. =)
>
> The commit where the bug is introduced would be this:
> https://github.com/xfce-mirror/xfdesktop/commit/
> f8fc72957dda162d7d310831494a336da849a6c
>
> Tomorrow I try reverting this commit.
>
> Regards,
> Thanks for all!.
>
> Matias

Yeah, I'm thinking the issue it the icons have their locations set and queued in the XfdesktopFileIconManager's xfdesktop_file_icon_manager_add_icon but not getting updated when the screen size change happens. It's probably easier to remove that queue and let the icon view handle that placement. Did you have any luck reverting that commit?

Hi,

> Did you have any luck reverting that commit?

No, the code was changed several times after this commit. I tried to revert all, but at least for me it was impossible. Sorry. :S

> It's probably easier to remove that queue and let the icon view handle that placement.

Please, try it, and tomorrow I will test it extensively!.

Regards,
Matias.

Created attachment 5942
0001-Sort-pending-icons-on-resize-Bug-11266

The icon view now emits a resize-event when the grid size changes.
When that happens, the file icon manager will update the pending
icons to their new location based on the cache file it reads from.

Please test this out. It may still run into an issue of not getting
a resize event before it starts adding icons to the icon view.

Hi,
Regarding the patch seems correct, it is a change that I think necessary, (In my taste just missing rename the cache file to contain the grid size instead desktop size).

However, in any case, please leave open the bug!.
It is very difficult to prove, and in the tests that I did, seems to work,. but the bug is very sporadic to ensure on 100% that the patch fix it.

Thanks for testing. Pushed to master for additional testing/feedback
http://git.xfce.org/xfce/xfdesktop/commit/?id=633eed4cf17491b5853df57e3dd7985a33546198

*** Bug 11181 has been marked as a duplicate of this bug. ***

Hi! Is this fix included to 4.12? Is there a reason for me to update my XFCE to 4.12?

Yes it has. Well upgrading means your icons should stay where you like them.

(In reply to Eric Koegel from comment #36)
> Yes it has. Well upgrading means your icons should stay where you like them.

I have just upgraded to 4.12 and the patch seems to be incorrect. After 3 relogins my icons are mixed again. Also button (don't know how to translate correctly) "reorganise icons" places them behind the desktop (in the left side). Pressing F5 gets them back

In , Elfy (elfy) wrote :

(In reply to yanpaso from comment #37)
> (In reply to Eric Koegel from comment #36)
> > Yes it has. Well upgrading means your icons should stay where you like them.
>
> I have just upgraded to 4.12 and the patch seems to be incorrect. After 3
> relogins my icons are mixed again. Also button (don't know how to translate
> correctly) "reorganise icons" places them behind the desktop (in the left
> side). Pressing F5 gets them back

Thanks for this. Seeing the same here with that.

A new fix has been pushed to master. This change prevents that the RC file with the saved icon positions is overwritten while the icons are being restored on session start.

http://git.xfce.org/xfce/xfdesktop/commit/?id=2ad16b8efe9b576b998e442a3c01b9d7c3a91fbb

In , Xfce-z (xfce-z) wrote :

I'm also having this problem in the latest Xubuntu 14.04. After both logout AND reboot, icon positions are always reset starting from top left. This is worse than it was before some xfdesktop updates that were pushed to Xubuntu a month or two ago (latest version in the repo is 4.11.8-0ubuntu0.1.

Although spatially sorted from top to bottom and left to right from the top left corner, icons are not sorted in alphabetical folder/file order. Their order seems kind of random. I wonder if the row/column indices are getting confused.

I've tried saving/not saving session on logout, clearing sessions, and deleting all .rc files in /.config/xfce4/xfdesktop, to no effect.

Thaddaeus, I built and installed the latest xfdesktop from git (easy as pie, no wild dependencies!), have tested it a bunch, no luck. No matter what I do, icon positions are reset on every logout and every reboot, so it seems your latest patch pushed to master hasn't helped.

$ xfdesktop --version
This is xfdesktop version 4.12.0git-0e4a8ee, running on Xfce 4.10.
Built with GTK+ 2.24.23, linked with GTK+ 2.24.23.
Build options:
    Desktop Menu: enabled
    Desktop Icons: enabled
    Desktop File Icons: enabled

Anything else I can do to help debug?

What's about an idea to test xfdesktop 4.8 or 4.10 and then compare with the latest version ans see which pieces of code have been added?

Martin, do the icon positions reset after restarting only xfdesktop? Furthermore, please attach the debug output of "xfdesktop --enabel-debug" and your .rc file(s) which are located in ~/.config/xfce4/desktop.

In , Xfce-z (xfce-z) wrote :

Thaddaeus,

No, icon positions don't reset after restarting only xfdesktop using --quit and then running it again. I ran --enable-debug and got this:

DBG[xfdesktop-common.c:232] xfdesktop_debug_set(): debugging enabled

Is it now logging somewhere?

In , Xfce-z (xfce-z) wrote :

Created attachment 6059
mspacek's .rc file

For privacy, file names were replaced with icon* names.

In , Xfce-z (xfce-z) wrote :

Created attachment 6061
debug messages

Here are some debug messages that printed to the terminal from which I ran xfdesktop --enable-debug.

Does the bug occur if you reduce the amount of desktop icons?

Other than that, we need to obtain the debug log from xfdesktop when initially started. Assuming that you have a default Xubuntu installation, please follow these instructions:

Copy /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml to ~/.config/xfce4/xfconf/xfce-perchannel-xml/ and apply the following change:

--- xfce4-session.xml.orig
+++ xfce4-session.xml
@@ -29,6 +29,7 @@
       <property name="Client3_PerScreen" type="bool" value="false"/>
       <property name="Client4_Command" type="array">
         <value type="string" value="xfdesktop"/>
+ <value type="string" value="--enable-debug"/>
       </property>
       <property name="Client4_PerScreen" type="bool" value="false"/>
     </property>

Now relog and attach the output of the filtered session log file:

$ grep DBG ~/.cache/upstart/startxfce4.log

Xfdesktop from ppa doesn't decrease amount of icons.

yanpaso, I'd like to know if the icon positions still reset after removing some of the desktop icons.
Also, please build xfdesktop from source to test the recently applied fix.

Have tested in Virtualbox (xubuntu). Everything was perfect. Icon stayed in their places in every case. In 2-3 days will test it on my main OS and netbook.

In , Xfce-z (xfce-z) wrote :

Created attachment 6070
$ grep DBG ~/.cache/upstart/startxfce4.log

Thaddaeus, yes it seems I get the bug no matter how many icons I have on my desktop. OK, I've followed your instructions to enable debugging, moved all my icons into a single folder on the desktop called "stuffs", logged out, logged back in, and grepped the startxfce4.log. Results are attached.

Both on desktop and netbook patch seems to be correct. icons are on their place

Changed in xfdesktop:
status: Confirmed → Incomplete

yanpaso, this is good news. Thanks for testing the fix.

Martin, before you terminate the session, does the .rc file reflect the current icon positions? Also, make sure that you are running xfdesktop from git master.

In , Xfce-z (xfce-z) wrote :

Thaddaeus, yes, from what I can tell, the .rc file reflects the current icon positions. In fact, when I log in, to restore positions, I delete the existing file, restore from a backup, run xfdesktop --reload, and icon positions are restored.

Yes, I'm running xfdesktop from git master. I just updated again, recompiled, installed, and logged in and out. Icon positions are still reset on login.

Also troubled by this bug, I'm delighted and thankful to see there is so much work on it which resulted in a working fix.

If I understand correct this has been pushed to master some time ago?

Since that has been some time ago, is there any indication when this fix will be distributed to the xfdesktop4 4.11.8 users as an update?

Martin, right now I have no clue why it fails in your case. I'll look at restore mechanism again and do some testing.

Is anyone else using 4.12.1 or git master still affected by this bug?

Thaddaeus, I'm using xfdesktop 4.12.1 on Arch Linux the bug is still occurring. Please, let me know how can I be of any help.

In , Xfce-z (xfce-z) wrote :

I just realized, one thing that's different about my setup is that I have my panel along the bottom of the screen, not along the top as per default. Maybe that makes a difference? I have a 1080p screen (1920x1080), the panel height is set to 18 pixels, and my automatically generated .rc file is currently named "icons.screen0-1904x1046.rc". I guess it would make more sense if it had 1902x1080 in the name. Also, I have 2 workspaces. When I have a chance, I'll try and mess with the panel position and workspaces to see if they make a difference for remembering icon positions.

I have the panel at bottom and too two workspaces (1 left, 2 right) and I haven't this bug anymore. Maybe you should try creating new user and experimenting in clean configuration workspace?

In , Xfce-z (xfce-z) wrote :

Created attachment 6134
DBG messages from main account

I'm stumped. I made a new test account and configured its desktop to be, AFAIK, the same as in my main account (icon size 22 instead of 48 pix, black background, panel bottom of screen, panel height 18 pix). Icon positions for the test account are remembered between logins, but not for my main account.

The only other relevant difference I can think of is that on the test desktop, I only have a few test files and folders with short names. On my main account, I have many more, with longer names. But I controlled for that by sticking all my icons into a single folder and adding a few test icons with short names to the desktop. Still, none of their positions are remembered.

I logged DBG messages from xfdesktop for both accounts. Here is the log for the main account.

Afterwards, I also tried switching the test account to the same theme (Numix), font size (9), compositor setting (disabled), and workspace switching behaviour (no wrap at screen edge) as my main account. Test account continues to remember its icon positions.

In , Xfce-z (xfce-z) wrote :

Created attachment 6135
DBG messages for test account (icon positions remembered)

Here is the log for the test account, which remembers icon positions on login/logout.

In , Xfce-z (xfce-z) wrote :

BTW, this was running off git master as of today:

$ xfdesktop --version
This is xfdesktop version 4.12.0git-b091ec3, running on Xfce 4.10.
Built with GTK+ 2.24.23, linked with GTK+ 2.24.23.
Build options:
    Desktop Menu: enabled
    Desktop Icons: enabled
    Desktop File Icons: enabled

Also, I noticed that the git commit reported by --version isn't updated unless I re-run ./autogen.sh or (probably) ./configure.

Created attachment 6161
add extra debug output

I guess that adding some extra debug output may help to see if xfdesktop is actually looking for the correct RC file.
The filename contains the size of the work area which may alter during session start, and therefore influence the icon restore mechanism.

I see last path [http://git.xfce.org/xfce/xfdesktop/commit/?id=2ad16b8efe9b576b998e442a3c01b9d7c3a91fbb] included to 4.12.1, but this version still affected by this bug.

I'm using xfdesktop4 4.12.0-1ubuntu1 on freshly installed Xubuntu 15.04, and the bug is still on.

I'm using 4.12.0 on a fresh Xubuntu 15.04 install, and this bug still affects me.

This bug reproduced when I was playing with two monitors. I extended them, then unplugged HDMI, restarted mdm service (display manager) and voila - icons order is wrong.

nam1962 (amauryat) wrote :

I'm affected by this bug on :
trusty + 4.10
vivid + 4.12
wily + 4.12

Alright. The buggy behavior is still not fixed completely.

Can anyone apply the additional change from comment #62 and attach the debug output to this report?

I don't know how to reproduce. Once I faced with it - was changing resolutions and diconnecting two monitors. Maybe it will be easier totally rewrite this fragment?

In , Netfab (netfab) wrote :

Created attachment 6384
xfdesktop-4.12.2 built with --enable-debug=full debug log

(In reply to Thaddaeus Tintenfisch from comment #65)
> Can anyone apply the additional change from comment #62 and attach the debug
> output to this report?

Hi,

I'm using xfdesktop-4.12.2 on gentoo, and some (not all) desktop icons positions are regularly reseted.
I rebuilt xfdesktop-4.12.2 with the patch from comment #62 and the --enable-debug=full configure flag.

Attached file is my ~/.xsession-errors file captured after a session start when desktop icons positions were completly messed up.

At the end you can notice :
> DBG[xfdesktop-icon-view.c:3842] xfdesktop_icon_view_icon_find_position(): old position didn't exist or isn't free, got (1,0) instead
for each icon which was not in its normal position.

Faced after relogging. I may test and attach debug info if there is a need

Created attachment 6395
4.12.2

Updated to 4.12.2. Now after logging out order stays the same, but icons shrink to stack.

Hmm, reverted to package, which I wa using before, this behavior still goes on. So I guess update to xfce 4.12 is guilty (Mint 17.2) or MDM

Hi,
I'm experiencing the problem on Xubuntu 15.04 which comes with Xfce 4.12 (fresh install)
It is very annoying.
If you need any further testing, just ask me I'll be happy to help.

I have no external montor, just laptop screen.
I never change desktop resolution.
I have 40+ icons.
It seems not to happen 100% of the time...

Regards

I forgot: it seems the problem happens only on reboot.
When I just log out/log in, icons remain in their position...

Jason, please install and test xfdesktop 4.12.2 from this PPA:

https://launchpad.net/~xubuntu-dev/+archive/ubuntu/xfce-4.12

Xubuntu 15.04 ships with version 4.12.0 which is affected by this bug.

The log file from comment #67 indicates that the icon order can still partially reset with the latest version.

During session start the size of the desktop area may change several times (mainly due to panels being started slowly). However, only the final size is appended to the name of the save file later on.
So, xfdesktop iterates through the desktop files/icons to restore their positions. It tries to find the according save file for the _current_ (maybe temporary) size of the desktop area. This fails for the first few icons, because only a save file for the final size exists.

Sadly, I was not able to work on this yet. It needs to be discussed with Eric also.

Changed in xfdesktop:
status: Incomplete → In Progress

*** Bug 12098 has been marked as a duplicate of this bug. ***

(In reply to Thaddaeus Tintenfisch from comment #73)
> Jason, please install and test xfdesktop 4.12.2 from this PPA:
>
> https://launchpad.net/~xubuntu-dev/+archive/ubuntu/xfce-4.12
>
> Xubuntu 15.04 ships with version 4.12.0 which is affected by this bug.

Hi!

I updated and rebooted a few times.
The bug seems fixed for me, at this time.

If it show again, i'll come back to tell you.

Anyway thanks for your help!

Can't reproduce with this package too. At least this package lessens frequency of this bug

Goth Queen (artistbraab) wrote :

In response to comment #97 by Thaddaeus Tintenfisch (thad-fisch):

Thaddaeus, this might very well be it. I noticed that, if I boot, reach the "fill in password" screen, fill it in immediately and continue boot into my desktop, the icons are reset.

However, when I turned my box on, go for a coffee, and log in when I come back, all the icons remain at their original position.
I repeated this several times, and found that if I wait before filling in my password and booting into my desktop, all icons remain at their original position. Hence, "some time to let the system catch up" seems to do the trick.

Does anybody else also see this behaviour?

I'm on xfdesktop4 4.11.8 (Xubuntu 14.04.3)

Thomas Schweikle (tps) wrote :

Yes this is what I see too, but it depends …: if for some reason while my desktop is prepared after logging in something starts using disks heavily icons will rearrange, even if the system had time to calm down. Until now the whole system of arranging icons depends on exact:

1. read the positions from ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc
   (or if it exists and matches screen width/height: ${HOME}/.config/xfce4/desktop/icons.screen0-<width>x<height>.rc)
2. read directory content from ${HOME}/Desktop while reading rearrange icons to given positions

If this is not done exactly after each other icons will rearrange. Both actions are now distinct and started at the same time, running concurrently. Now just guss what happens, if 2 is ready before 1, or 2 starts, 1 catches up – icons will rearrange completly or partly. Why? Because reading an item from ${HOME}/Desktop without finding it in position data structures defaults the position of this item. It will be placed to the next free, available position. Since all positions are free until ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc is read the icon position is located by what you defined as default for the first one read (0,0) incremented by one position to the right or down for the next one. If finally ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc is read, all positions are thrown away, since all icons are arranged already.

Now lets have a look what happens if reading ${HOME}/Desktop starts, but is caught up by reading ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc: the first few icons are rearanged, then, since data structures are filled and icons found these are positioned as given. But only it the position the icon wants is free. If it is not, this icon goes for the default – finding the first free place by using what is defined: starting at 0,0, extending one down filling colums from top left to bottom down.

Next if reading ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc starts, but is caught up by ${HOME}/Desktop: in this case all icons with positions in data structures are placed as expected. Then all those not having positions are placed as defaults define, occupying free places.

All of this is made more complicated as the system immediately stores "newly" found icon positions to ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc overwriting this file as often as there are items in ${HOME}/Desktop.

From this:
1. make sure reading ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc is complete BEFORE
2. reading any items from ${HOME}/Desktop

and

3. make sure ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc is never written before all items in ${HOME}/Desktop are read and positioned.

A simple solution would be to block execution of reading items from ${HOME}/Desktop until ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc is read. And block writing ${HOME}/.config/xfce4/desktop/icons.screen0-default.rc while items are read from ${HOME}/Desktop.

(In reply to jason.braddock.69 from comment #76)
> (In reply to Thaddaeus Tintenfisch from comment #73)
> > Jason, please install and test xfdesktop 4.12.2 from this PPA:
> >
> > https://launchpad.net/~xubuntu-dev/+archive/ubuntu/xfce-4.12
> >
> > Xubuntu 15.04 ships with version 4.12.0 which is affected by this bug.
>
> Hi!
>
> I updated and rebooted a few times.
> The bug seems fixed for me, at this time.
>
> If it show again, i'll come back to tell you.
>
> Anyway thanks for your help!

Hi guys,

after a few weeks, I can say that it works most of the time.
Still, sometimes a few icons have their positions reseted... Maybe once a week... seems rare and random...

lumbricus (lumbricus) wrote :

I struggle with a similar behaviour with xubuntu 15.04, but it might be a different bug related to two monitors with different resolution. Icons cannot be positioned outside of size of the smaller monitor and only on the primary monitor (although this is the larger one). If you change the icon size you can move the icons but there position is lost on log out.

Should I open a seperate ticket?

More details:
With standard settings everything seems to work fine, mirror is activated and I see one desktop on both monitors. Since one montior has a higher resolution the desktop is scaled on this monitor (and it is a bit stretched). Moving icons on seems to work fine. With a fresh user I could reproduce:
* mirrored monitor - everything works
* Display -> uncheck "mirror displays"
* moving icons works only in upper left area of the primary monitor (size of the secondary monitor)
* change Desktop settings -> Icons -> Icon size by any number of pixels, now you can move the icons everywhere
* log out, all icons jump back to positions of before chaning icon size

I use the latest PPA version:

$ xfdesktop --version
This is xfdesktop version 4.12.2, running on Xfce 4.12.
Built with GTK+ 2.24.27, linked with GTK+ 2.24.27.
Build options:
    Desktop Menu: enabled
    Desktop Icons: enabled
    Desktop File Icons: enabled

Yanpas (yanpaso) wrote :

You should ask this on xfce bugzilla (link is attached here on launchpad). No one from xfce team reads launchpad I guess

Thomas Schweikle (tps) wrote :

May be. But I found this bug already filed at xfce bugzilla -- but not on lauchpad. And: how should anyone at Ubuntu know about this bug if not filed to lauchpad?

Yanpas (yanpaso) wrote :

Attaching xfce bugs to launchpad is useless. No one from canonical supports xfce software. The only reasonable bugs that may be filed to launchpad is outdated xfce packages with security vulnerabilities

Goth Queen (artistbraab) wrote :

Thanks Yanpas, your remark helped me a lot! Viewing the thread on https://bugzilla.xfce.org/show_bug.cgi?id=11266 I found the remark that led to a solution that seems to work for me.

As suggested there I:
- added the PPA (sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12)
- sudo apt-get update
- Opened up Synaptic and searched for xfdesktop
- Marked xfdesktop for update (dependencies selected automatically) and clicked APPLY
- As a result, Synaptic updated xfdesktop to version 4.12.2
- Exit Synaptic
- Removed Xubuntu Developers ppa ((sudo add-apt-repository --remove ppa:xubuntu-dev/xfce-4.12) to keep everything else as a "stable" version.

Did this on multiple boxes (32 and 64 bit) and it seems to solve the problem!

Thanks to all developers for solving this annoying bug!

Goth Queen (artistbraab) wrote :

Sorry for the confusion, but have to report that the update went just fine, but the icons reset again today on all boxes with version 4.12.2

Thomas Schweikle (tps) wrote :

As for my analysis of this bug: it can't be gone at all, because there is a chance the data read to position the icons is read slower than the icons are positioned by default. There is no guaranty this could not happen looking at the code written. The bug isn't fixed at all!

This bug is not fixed at all. There is a good chance reading icon positions from $HOME/.config/xfce4/desktop.conf is not finished before reading icons from $HOME/Desktop having icons rearrange. There is no locking nothing to make sure the icon positions are known BEFORE starting to read "Desktop".
And if this occurs the icons WILL again rearrange!
It will depend on how many applications you start, on IO-load, what is done in background. Processes reading many small files from disk, like man-page-updates, can trigger it.
A fast look at what the code does made clear: you do not have anything making sure the two threads: read "Desktop", read "Config" are not forced to run after each other. The part positioning the icons isn't locked at all. It will run concurrently to read config if read desktop is finished. It is triggered every time an item is read from read Desktop -- regardless reading configs is ready or not.

(In reply to <email address hidden> from comment #79)
> This bug is not fixed at all. There is a good chance reading icon positions
> from $HOME/.config/xfce4/desktop.conf is not finished before reading icons
> from $HOME/Desktop having icons rearrange. There is no locking nothing to
> make sure the icon positions are known BEFORE starting to read "Desktop".
> And if this occurs the icons WILL again rearrange!
> It will depend on how many applications you start, on IO-load, what is done
> in background. Processes reading many small files from disk, like
> man-page-updates, can trigger it.
> A fast look at what the code does made clear: you do not have anything
> making sure the two threads: read "Desktop", read "Config" are not forced to
> run after each other. The part positioning the icons isn't locked at all. It
> will run concurrently to read config if read desktop is finished. It is
> triggered every time an item is read from read Desktop -- regardless reading
> configs is ready or not.

Hi,
I don't know the code, so forgive me if I am rude or naive, but why are there two threads if they need to run one after the other?
Shouldn't there be a single thread running things properly?
Regards

Mélodie (meets) wrote :

It has also affected an install I did with Xubuntu 14.04.3. I had to position the icons in a particular way for a group of users, which I did, but could never get the @!*^%£$@@@!!! to keep their place as they were expected to.

(This was already posted mistakenly on launchpad: https://bugs.launchpad.net/ubuntu/+source/xfdesktop4/+bug/1335492/comments/104 )

I struggle with a similar behaviour with xubuntu 15.04, but it might be a different bug related to two monitors with different resolution. Icons cannot be positioned outside of size of the smaller monitor and only on the primary monitor (although this is the larger one). If you change the icon size you can move the icons but there position is lost on log out.

Should I open a seperate ticket?

More details:
With standard settings everything seems to work fine, mirror is activated and I see one desktop on both monitors. Since one montior has a higher resolution the desktop is scaled on this monitor (and it is a bit stretched). Moving icons on seems to work fine. With a fresh user I could reproduce:
* mirrored monitor - everything works
* Display -> uncheck "mirror displays"
* moving icons works only in upper left area of the primary monitor (size of the secondary monitor)
* change Desktop settings -> Icons -> Icon size by any number of pixels, now you can move the icons everywhere
* log out, all icons jump back to positions of before chaning icon size

I use the latest PPA version:

$ xfdesktop --version
This is xfdesktop version 4.12.2, running on Xfce 4.12.
Built with GTK+ 2.24.27, linked with GTK+ 2.24.27.
Build options:
    Desktop Menu: enabled
    Desktop Icons: enabled
    Desktop File Icons: enabled

I'm using xubuntu-dev-PPA's version for hlf a year on my Linux Mint 17.2 and the bug was never reproduced. Maybe this fix doesn't fix bug totally, but it's quite good. Will it be pushed to master?

megaus (megaus) wrote :

 In the last few months I didn't face with this issue, so it seems to be fixed...

$ xfdesktop --version
This is xfdesktop version 4.12.2, running on Xfce 4.12.
Built with GTK+ 2.24.23, linked with GTK+ 2.24.23.
Build options:
    Desktop Menu: enabled
    Desktop Icons: enabled
    Desktop File Icons: enabled

Hi - is there any update on this issue? I'll be really happy the day I can finally sort out my desktop icons. Thanks all!

In , Ap-z (ap-z) wrote :

I'm at version
xfce-base/xfdesktop-4.12.3::gentoo
and still my icons are reordered on _every_ login.

Patiently waiting for a fix...

rattskjelke (rattskjelke) wrote :

I have been using Xubuntu for many years and haven't had this problem for a long time. I just did a fresh reinstall of 15.10. I don't know what xfce version it has but this problem of desktop icons rearragning themselve on bootup started again.

I'm using testing version. Deleteing some icon/item causes xfdesktop to freeze. Is it reproducible with normal xfdesktop? Should I open new bug?

In , Ap-z (ap-z) wrote :

Created attachment 6706
Patch for xfdesktop-file-icon-manager.c in version 4.12.3 (on Gentoo)

Someone already worked out that this is a problem with concurrency. As mentioned before I'm affected on every login with an eight core CPU.

The attached patch handles files in xfdesktop_file_icon_manager_load_desktop_folder() synchronized.

The problem could be solved more elegant, but this fixes the bug for me.

There should be only one simple single process and not many complex threads keeping waiting for each other

The files that are created in ~/.config/xfce4/desktop should contain the resolution in the name and not the size of the workarea. At least for me almost every time i rebooted the values of the workarea were a little bit different and so the icons where all rearanged to the top left side.
I changed the source to use screen resolution for the filenames and now its working for me.
So why not using the resolution instead of the work-area size?

I can confirm that desktop icons order resets. During relogin. As mentioned by Yan Pas in Comment 8.

I do not use any graphical login manager. I start xfce by run startxfce4 from xinit script. I have only one rc file in ~/.config/xfce4/desktop according to my screen size.

Problem does not occur:
- after reboot computer and first time login.
- when I stop and restart xfdesktop (xfdesktop --quit; xfdesktop &)
- when a screen size change.

Problem occurs only when I logout from xfce (AppMenu -> Logout -> Logout) and login again.

After monitoring the problem I found, that rc file contains the correct information about icon positions after log out . But after second login this file is rewrited with incorrect one. I have found a workaround - added this script to Application autostart list:

------------------------------------------------
#!/bin/sh

xfdir="/home/username/.config/xfce4"

# save rc files
rm -rf "/tmp/desktop"
cp -fr "$xfdir/desktop" "/tmp"

# wait xfdesktop starts and rearanges icons
sleep 5

# compare saved files with new
cmp="`diff $xfdir/desktop /tmp/desktop`" #compare

# if xfdesktop rearrange icons, restore rc files
if [ "$cmp" ]; then
 cp -fr "/tmp/desktop" "$xfdir"
 xfdesktop -R #refresh desktop
 notify-send "Icons are restored!"
else
 rm -rf /tmp/desktop-icons
fi
------------------------------------------------

era (esa-rajam) wrote :

I did a fresh reinstall of 16.04 some weeks ago. Icons are moving again on boot.
I have tree monitors connected and icons are moving to leftmost.
I started with Xubuntu version 15.04 and had same problem.
On version 15.10 I get around problem by adjusting icon size.
On version 16.04 this trick is not working.

I can also confirm this bug.

"Jan Do wrote:
Problem does not occur:
- after reboot computer and first time login.
- when I stop and restart xfdesktop (xfdesktop --quit; xfdesktop &)
- when a screen size change."

For me this was true with xfdesktop 4.10.*.

Nowadays with 4.12.2 or 4.12.3 the problem occurs most of the time also in the "after reboot computer and first time login"-case, while the other two cases mentioned by Jan Do are still not affected.

Best Regards

@ Andreas Prieß:

Tested your patch with gentoo. Does not work, because of the following error (extracted from xfdesktop-file-icon-manager.patch.out)

PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch --dry-run -f < '/etc/portage/patches//xfce-base/xfdesktop-4.12.3/xfdesktop-file-icon-manager.patch'

=============================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- xfdesktop-file-icon-manager.c 2015-05-17 11:16:26.000000000 +0200
|+++ xfdesktop-file-icon-manager.c 2016-04-16 04:22:49.369727370 +0200
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored

Any ideas to solve this?

In , Ap-z (ap-z) wrote :

(In reply to Gerold Schellstede from comment #91)

Gentoo only:

> PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch --dry-run -f <
> '/etc/portage/patches//xfce-base/xfdesktop-4.12.3/xfdesktop-file-icon-
> manager.patch'

I've never used custom patches in /etc/portage/patches/..., you probably have to add a path fragment to the patch file in line 1 and 2.

> Any ideas to solve this?

I created a local ebuild at /usr/local/portage/xfce-base/xfdesktop/. Just copy the ebuild xfdesktop-4.12.3.ebuild and the files folder from /usr/portage/xfce-base/xfdesktop/. Create a copy of the ebuild as xfdesktop-4.12.3-r1.ebuild and add the following three lines:

post_src_prepare() {
      epatch "${FILESDIR}/xfdesktop-file-icon-manager.patch"
}

Of course add my patch to the files folder and create the checksums with
$ ebuild xfdesktop-4.12.3-r1.ebuild digest

Then you should be able to
$ emerge --update --ask xfce-base/xfdesktop

can somebody confirm. that after logout from xfce. desktop configuration file has correct data about icons position.. and this file changed on xfdesktop init time? you need to disable login manager to access console after logout to check configuration file.

can somebody confirm. that after logout from xfce. desktop configuration file has correct data about icons position.. and this file changed on xfdesktop init time? you need to disable login manager to access console after logout.

@ Andreas Prieß:

1) Your were right. The suggested slight changes do the trick and the patch installs.

2) Unfortunately the patch has no effect at all.

@ Jan Do: I can confirm that.

Best regards

In , Ap-z (ap-z) wrote :

(In reply to Gerold Schellstede from comment #95)

> 2) Unfortunately the patch has no effect at all.

Ok, are you sure that xfdesktop is emerged with the patch applied?

If so, I'd guess there is at least one file on the desktop, that wasn't there on logout and therefore the icons are reordered on login. Or somehow the icon positions are rewritten at the wrong time, whatever may trigger that.

IIRC the config file with the icon positions is read repeatedly, once for each icon. So the first icon that does not have a saved position triggers a rewrite and all positions of not yet placed icons are lost and then reordered.

The solution could be to read this file only once at the beginning, so a rewrite does not affect previously known positions...

Could you describe what gets reordered when in your case?

(In reply to Andreas Prieß from comment #96)

Thanks for your answer and time!

> Ok, are you sure that xfdesktop is emerged with the patch applied?

Yes, 100%. Emerge tells me so and after emerging the patched version the xfce-desktop it needs a little more time to load the xfce-session.

> If so, I'd guess there is at least one file on the desktop, that wasn't
> there on logout and therefore the icons are reordered on login. Or somehow
> the icon positions are rewritten at the wrong time, whatever may trigger
> that.

No, the icons never change on this Desktop ;-) After logout, one can login on tty1 and verify that icon-file (~/.config/xfce4/desktop/...) is indeed correct.

> Could you describe what gets reordered when in your case?

Obviously the things are messed up at starting up the xfce-session. As I wrote before the error occurs with the 4.10 version only when I logout and login afterwards without reboot. With the 4.12 versions it occurs on every login.

In , Ap-z (ap-z) wrote :

Created attachment 6763
Patch for xfdesktop-file-icon-manager.c in version 4.12.3 to read icon positions from open file.

The attached patch adds three methods to replace calls to
xfdesktop_file_icon_manager_get_cached_icon_position().

Before, the file icons.screen-???.rc with the saved icon positions was opened, read and closed for each icon separately. If anything triggered a rewrite of the file, while the icon positions were still read individually, some icon positions were lost.

With my patch the file is only opened once and kept around until all icons have their position set.

This also fixes the bug for me, and it's a better solution too.

@ Gerold Schellstede:

Could you try this patch? Maybe this solves it for you, too...

> @ Gerold Schellstede:
>
> Could you try this patch? Maybe this solves it for you, too...

1) Installed it and deleted the old icon file, rebooted the machine, sorted the icons, rebooted again --> Icons were on place

2) Rebooted again, to test it again --> icons were rearranged in wrong order.

By the way: The problem is not only that icons are rearranged.

If one uses not the default theme of the mouse-cursor the theme switches sometimes to default, but only on the desktop. If one goes inside a window, e.g. firefox or libreoffice, the non-default theme is shown correctly.

Could this be linked to the other problem or is it a separate one?

Andreas Prieß, sorry, i think your patch did wrong thing. Because if your icons are rearranged and you have good copy of icons-rc file. Just replace rearranged icon-rc with copy. and press F5. How can you see icons goes back to right place - it means xfdesktop works without problems. the problem is more GLOBAL. bug can be caused by xfce4-session manager. or elsewhere

Robert Wolter (rwolter) wrote :

This bug is still present in xfce version 4.12.2 using Xubuntu 16.04.1.
Sometimes all icons are re-orderd during xfce startup, sometimes only some of them. The icons stay at their positions if the user only logs out and in again without rebooting.

I made an eventually interesting observation (I am on gentoo):

I changed more or less accidentally my desktop theme from "Clealooks" as part of the "Clealooks-phenix" package to "Clearlooks" as part from the "mate-themes" package. Thereby I uninstalled the "clearlooks-phenix" and installed the "mate-themes" package.

Since then it works with the icon order.

So can it be that the theme one uses, is of interest for the occurrence of the bug?

Best regards

I cheered to soon. Today the icon order was wrong again. So forget what I said before.

I have the same bug for the last 2 years including Xubuntu 16.10: desktop icons are re-arranged after restart.

My hotfix is an autostarting batch, where the 'backup*' directory contains my original files:

sleep 1
(cd ~/.config/xfce4/desktop/backup-2016-10-20/ && cp *.* ..)
xfdesktop --reload

The bug is noticeable on two connected monitors only, in my case.

Hi Ponec. Can you please try solution script from post 89.

Hi Jan Do.

Yes, the workaround #89 works well for me, thank you.
However I'm afraid that the bug discourages many beginners of XFCE.

(In reply to Ponec from comment #106)
> Hi Jan Do.
>
> Yes, the workaround #89 works well for me, thank you.
> However I'm afraid that the bug discourages many beginners of XFCE.

It discouraged me long time ago...
I left xfce with no regret

Patch from #89 solve issue with desktop icons order reset for me.
Thanks a lot!

Correction. Looks like I still have this issue, but more rarely with #98 patch.

problem persists here for xfdesktop 4.12.3 (OpenSuSE Tubleweed)

auditing (summary) shows the following after logon:

lots of reads from /home/thomas/.config/xfce4/desktop/icons.screen0-2544x971.rc
and then suddenly
a create icons.screen0-2544x971.rc.new.16834.tmp
a rename/move icons.screen0-2544x971.rc.new.16834.tmp to icons.screen0-2544x971.rc.new
a rename/move icons.screen0-2544x971.rc.new to icons.screen0-2544x971.rc

everything triggered/done by /usr/bin/xfdesktop (PID=16834)

inode IDs before and after logon differ and the original contents of icons.screen0-2544x971.rc are lost

meanwhile I have already 2 "solutions"

1. (the older one, from/for XFCE 4.10 (see Bug 9192))
- at every shutdown/startup of the machine I create a backup and
- there is a desktop shortcut to restore the last of those backups

2.
- systemd service looking for greeter process => removes all write permissions for .config/xfce4/desktop/ folder
- autostart script which 60 seconds after logon adds write permission for .config/xfce4/desktop/ folder
- obsoletes backup/restore

For me THE question is/remains, why at all has the positions file to be written to at logon/startup?

As it happens this seems not to be necessary, as my "solution" 2 shows.

Colin Hemming (b-ubuntuone14) wrote :

Seems to me that simply calling whatever function loads the icon positions after the rest xfdesktop has finished starting up would solve most of this. To prevent the position file being corrupted while starting (as it currently does) the file *should only be written out when the user expressly places an icon* and only save the position of icon that have been expressly placed. This would have the added benefit of any other icons tidying themselves up into the auto-arrange corner as others were moved away.

Hello, I've never had any problem in XFCE desktop I bought a new computer some days ago and I've starting to experience this bug.
Is it solved in version 4.14?
Is it going to be solved someday? Is there anyone working on it?
Is there a "full functional" workaround? The most common "solution" (so to speak) I've read about is giving

sudo chattr -i ~/.config/xfce4/desktop/icons*

Thanks.

Hi underpass, the only workaround i found yet is to use gnome desktop

Installed xubuntu 18.04 updated and the icons moved here and then.
The rc files in $HOME/.config/xfce4/desktop/ directory are created only when the icons move.

I thought that having all those rc files must have borked something, so I made a script that launches on startup that keeps only the latest icons*rc and removes all the other rc files. https://pastebin.com/0HFjZrGi
The script requires inotify-tools package installed and notify-send (to keep track on when the icon positions are saved).

The icons do seem to stay on login/logout, except the Trash that want's to stay in the top-left corner. Sometimes even File System and Home icons move too. They are managed by xfconf, maybe that's why their position is being reset. So I turned them off. If I need them, I can make a desktop file that launches thunar with those paths can replace them.

Now the icons do move if the panel is resized and then logout is made after that.
As soon as the panel is resized, it sets the new panel strut. That triggers a change of _NET_WORKAREA of the root window property, but if the icons are not moved a new rc file will not be created. That is when the icons reset their position on login.

Colin Hemming (b-ubuntuone14) wrote :

The cause was identified long ago https://bugs.launchpad.net/ubuntu/+source/xfdesktop4/+bug/1335492/comments/41 but still no one has applied a fix. I have two scripts. One of which saves the files on logout and another which I run at login that waits 10 seconds, then restores the file and resets the desktop. That totally solves it. Without my script, many of the icons reset and the others remain because xfdesktop doesn't wait for the whole config file to be read before continuing. The reset icons reassert their new position in the files. It's a major annoyance to not be fixed for so long.

This works for me:
The first script is set to autostart on login.
The second one is used for logout / reboot.

https://forum.xfce.org/viewtopic.php?pid=49764#p49764

The first script waits untill all the the panels are in the window stack, then sets the folder permissions of .config/xfce/desktop to 755. It also removes all but the latest rc file when a new rc is created in the folder. Requires inotify-tools to monitor when the rc files are created.

The second script opens a yad dialog and sets the folder permissions of .config/xfce/desktop to non-writable when logout / shutdown / restart is selected. Requires yad.

Miloš Pavlović (mpsrv) wrote :

Colin Hemming, I also have two scripts.

The first script is set to autostart on login.
The second one is used for logout / reboot.

https://forum.xfce.org/viewtopic.php?pid=49764#p49764

The first script waits untill all the the panels are in the window stack, then sets the folder permissions of .config/xfce/desktop to 755. If all the panels are loaded, then their struts are set and the workarea is correct. It also removes all but the latest rc file when a new rc is created in the folder. Requires inotify-tools to monitor when the rc files are created and notify-send to tell when the icon position is saved. By having only one rc conf file I don't have to reset the desktop on login.

The second script opens a yad dialog and sets the folder permissions of .config/xfce/desktop to non-writable when logout / shutdown / restart is selected. Requires yad.

sami (miaousami) wrote :

OMG is this bug still open?
lol

Jose Luis Suarez (jlsuarezm) wrote :

I have this behavior loosing desktop icon positions in Xubuntu since 16.04 and now in 18.04
Esto es xfdesktop versión 4.12.3, ejecutándose en Xfce 4.12.
Compilado con GTK+ 2.24.31, Enlazado con GTK+ 2.24.32.
Opciones de compilación:
Menú del escritorio: activado
Iconos de escritorio: activado
Iconos de archivos del escritorio: activado

I usually have desktop set up to don't show icons for: Trash, Personal Folder, File System or Devices
When I change this set up to show Trash icon, desktop icons behave correctly and don't move after login.
Still waiting for a fix

I just use the following workaround:

1. Move the file with desired desktop icons positions to "/etc/xdg/xfce4/desktop/icons.screen0.rc".

2. Create a new desktop file in "/etc/xdg/autostart" that deletes "/home/USERNAME/.config/xfce4/desktop" and reloads the xfdesktop - it has the following contents (use your user name instead of USERNAME and adapt the sleep interval if needed):

[Desktop Entry]
Exec=bash -c 'sleep 3 && rm -rf /home/USERNAME/.config/xfce4/desktop && xfdesktop --reload'
Name=Xfdesktop Reload
Terminal=false
Type=Application
StartupNotify=false

This restores my desired desktop icons positions on every login to XFCE. Note that when you want to rearrange your icons you need to update the "/etc/xdg/xfce4/desktop/icons.screen0.rc" file manually.

*** Bug 14031 has been marked as a duplicate of this bug. ***

Actually this bug seems to be easy to reproduce:

1. Adjust the colum-size of the panel to something odd
2. Logout
3. Login
---> All Icon-Posotions will reset

If you already have profiles for all possible free-screen-size combinations, delete some of the configs in ".config/xfce4/desktop," to make the bug happen again.

IMO one aspect which makes thing over-complex is, that profiles are saved per free-screen-size in .config/xfce4/desktop, instead of saving them per display-configuration (monitor setup and resolution).

IMO not good to make smart decisions for the user when only free-screen-size changes ... the user can re-sort desktop items on its own on things like panel-size change.

Hope I will find some time to work on this bug soon.

@alexxcons the patch proposed in Bug 14979 might help or worsen this one.

Hello, I've tested the xfdesktop 4.13.3 on Debian Testing (installed from the Experimental repository) and the problem is still there, exactly the same as in 4.12.
Any chance to have it solved in version 4.14? Sorry, I'm no coder so I can't be of much help here.

Changed in xfdesktop:
status: In Progress → Confirmed

Created attachment 8463
patch to add symlink to the latest working config, used as fallback

(In reply to Underpass from comment #119)
> Any chance to have it solved in version 4.14?

Here we go.

One concrete problem is, that opening the setting menu of the panel will add one extra pixel to the panel(some border showing the focus). That will change the size of space available for xfdesktop.
If the desktop is saved now, it will be e.g. saved as icons.screen0-1366x701.rc

After a logout + relogin the panel will not have this extra-pixel. So xfdesktop searches for icons.screen0-1366x700.rc ... possibly does not exist --> Fallback to just place all icons in a line.

The attached patch will always create a symlink "icons.screen.last.rc" on save, pointing to the current *.rc file, whenever a new .rc file is written.

This fix cures the symptoms. IMO should be fine for 4.14 .. however later on I would start to work on the actual problem, which is, that xfdesktop does not use the whole screen, but only the workarea. (Another logical error is, that the icon size is not saved in the .rc file, together with the grid, but somewhere else, independently)

Created attachment 8464
patch to add symlink to the latest working config, used as fallback

forgot to unlink existing links before adding link

Changed in xfdesktop:
status: Confirmed → In Progress

(In reply to alexxcons from comment #120)
> Created attachment 8463 [details]
> patch to add symlink to the latest working config, used as fallback
>
> (In reply to Underpass from comment #119)
> > Any chance to have it solved in version 4.14?
>
> Here we go.
>
> One concrete problem is, that opening the setting menu of the panel will add
> one extra pixel to the panel(some border showing the focus). That will
> change the size of space available for xfdesktop.
> If the desktop is saved now, it will be e.g. saved as
> icons.screen0-1366x701.rc
>
> After a logout + relogin the panel will not have this extra-pixel. So
> xfdesktop searches for icons.screen0-1366x700.rc ... possibly does not
> exist --> Fallback to just place all icons in a line.
>
> The attached patch will always create a symlink "icons.screen.last.rc" on
> save, pointing to the current *.rc file, whenever a new .rc file is written.
>
> This fix cures the symptoms. IMO should be fine for 4.14 .. however later on
> I would start to work on the actual problem, which is, that xfdesktop does
> not use the whole screen, but only the workarea. (Another logical error is,
> that the icon size is not saved in the .rc file, together with the grid, but
> somewhere else, independently)

as i said in comment #88 why using the workarea instead of the whole screen

> as i said in comment #88 why using the workarea instead of the whole screen
After some thinking on your proposal, I have to say: Its complicated.
One problem is, that xfdesktop currently has no support for multiple screens. The "screen0" in the name of the *.rc file currently is just hardcoded, whereas the workarea describes the free area among all attached screens. (So the current screen0 actually is a lie)

Just changing the filename to screen res. for most users might be sufficient. However e.g. if you have a laptop with docking station, you might actually want to use two configurations, with and without extra screen, currently resulting in two *.rc files.

Following your proposal, If you name the file like the first screen, than there will be only one file. A solution could be to put the res. of all available screens into the filename ... but that looks like an ugly workaround for me.

IMO much better would be to have one file per screen, named something like "monitor id"."screen resolution".rc
Each of these files could than consist as well background image info, icon size, etc.
However that would be a bigger change. I opened a seperate bug for that: bug #15344 . Will try to work on it when I have time.

Created attachment 8467
same patch for the xfce-4.12 branch

Attached the same patch for the xfce 4.12 branch (the original patch refuses to be applied there)

Please test it, if you can. I would like to push it soon.

I think "last" is misleading in the filename, I'd personally go with "latest".
Other than that, this looks very non-intrusive.

Not sure which problems it fixes exactly because this bugreport is blown way out of proportion and it's impossible to read and understand it all (and to be sure that it's really about *one* bug). But if you have good experiences I guess/hope it won't hurt :)

It's not only one bug. :)
The icons reposition in other cases.
The rc config file is created only after the icons are moved.
If you resize the panel just a few pixels close the panel settings
and logout the icons will move because their position isn't saved.

Another one is the Trash icon that moves to the upper left corner.
And sometimes File System and Home icon position resets.
But I think that those three icons are handled by Xfconf.

Colin Hemming (b-ubuntuone14) wrote :

I have now written a patch script to deal with this problem on my machine as it's been like this for many years with no progress. I don't understand the internals, but it occurs 100% when the desktop starts laying out icons before the underlying system has read the configuration (it occasionally gets the first couple), so starts "not knowing" where icons go, so creates a new entry, starting from the left side of the screen. I have eradicated the problem by holding a backup of the configuration, waiting for disk activity to drop to near zero after login, then restoring the backup and reloading the configuration. It takes a short while before the desktop sorts itself, but entirely fixes the problem. My job then watches the configuration file to see if it's subsequently updated, requiring a new backup. All the talk of multiple monitors and so on is a separate issue unrelated to the bug itself.

I just tried to fix the most critical case, in which all icons reset to default position (since no rc config matching the current workarea is found )

(In reply to Miloš Pavlović from comment #126)
> The rc config file is created only after the icons are moved.
> If you resize the panel just a few pixels close the panel settings
> and logout the icons will move because their position isn't saved.

This case should be fixed now. Since now the symlink will be used as fallback.

> Another one is the Trash icon that moves to the upper left corner.
> And sometimes File System and Home icon position resets.
> But I think that those three icons are handled by Xfconf.

I did not look into that so far .. should be reported as separate bug, if it is still a problem. This bug is already much too long.

Hi Alex,

This desktop icons order resets problem is also present now at Manjaro.

regards LF

inxi -Fxzc0
System: Host: dolphin Kernel: 5.0.10-2-MANJARO x86_64 bits: 64 compiler: gcc v: 8.3.0 Desktop: Xfce 4.13.3git-UNKNOWN
Distro: Manjaro Linux

xfdesktop --version
Dieses ist xfdesktop Version 4.13.3git-UNKNOWN, auf Xfce 4.13.
Erstellt mit GTK+ 3.24.7, verknüpft mit GTK+ 3.24.8.
Optionen bei der Erstellung:
Schreibtischmenü: aktiviert
Schreibtischsymbole: aktiviert
Schreibtischdateisymbole: aktiviert

pacman -Si xfwm4

Repository : extra
Name : xfwm4
Version : 4.12.5-1
Description : Xfce window manager
Architecture : x86_64
URL : http://www.xfce.org/
Licenses : GPL2
Groups : xfce4
Provides : None
Depends On : libxfce4ui libwnck libdrm hicolor-icon-theme
Optional Deps : None
Conflicts With : None
Replaces : None
Download Size : 491.47 KiB
Installed Size : 2028.00 KiB
Packager : Evangelos Foutras <evangelosNOSPAMfoutrelis.com>
Build Date : Sun Jul 29 15:24:36 2018
Validated By : MD5 Sum SHA-256 Sum Signature

xfwm4 --version
This is xfwm4 version 4.13.1git.UNKNOWN (revision UNKNOWN) for Xfce 4.13
Released under the terms of the GNU General Public License.
Compiled against GTK+-3.24.5, using GTK+-3.24.8.

Build configuration and supported features:
- Startup notification support: Yes
- XSync support: Yes
- Render support: Yes
- Xrandr support: Yes
- Xpresent support: Yes
- Embedded compositor: Yes
- Epoxy support: Yes
- KDE systray proxy (deprecated): No

Hi Alex,

This desktop icons order resets problem is also present now at Manjaro.
(Funny is that there are different versions of xfce?)

regards LF

inxi -Fxzc0
System: Host: Kernel: 5.0.10-2-MANJARO x86_64 bits: 64 compiler: gcc v: 8.3.0 Desktop: Xfce 4.13.3git-UNKNOWN
Distro: Manjaro Linux

xfdesktop --version
Dieses ist xfdesktop Version 4.13.3git-UNKNOWN, auf Xfce 4.13.
Erstellt mit GTK+ 3.24.7, verknüpft mit GTK+ 3.24.8.
Optionen bei der Erstellung:
Schreibtischmenü: aktiviert
Schreibtischsymbole: aktiviert
Schreibtischdateisymbole: aktiviert

pacman -Si xfwm4

Repository : extra
Name : xfwm4
Version : 4.12.5-1
Description : Xfce window manager
Architecture : x86_64
URL : http://www.xfce.org/
Licenses : GPL2
Groups : xfce4
Provides : None
Depends On : libxfce4ui libwnck libdrm hicolor-icon-theme
Optional Deps : None
Conflicts With : None
Replaces : None
Download Size : 491.47 KiB
Installed Size : 2028.00 KiB
Packager : Evangelos Foutras <evangelosNOSPAMfoutrelis.com>
Build Date : Sun Jul 29 15:24:36 2018
Validated By : MD5 Sum SHA-256 Sum Signature

xfwm4 --version
This is xfwm4 version 4.13.1git.UNKNOWN (revision UNKNOWN) for Xfce 4.13
Released under the terms of the GNU General Public License.
Compiled against GTK+-3.24.5, using GTK+-3.24.8.

Build configuration and supported features:
- Startup notification support: Yes
- XSync support: Yes
- Render support: Yes
- Xrandr support: Yes
- Xpresent support: Yes
- Embedded compositor: Yes
- Epoxy support: Yes
- KDE systray proxy (deprecated): No

Can i also add the 4.12 patch to 4.13 ? I have listed different versions of xfce?? So one or more --version commands must be wrong ?

Check the attachments, there is one patch for "master", which is the one you want for 4.13:
https://bugzilla.xfce.org/attachment.cgi?id=8464
An on for the "xfce-4.12" branch:
https://bugzilla.xfce.org/attachment.cgi?id=8467

They do the same thing .. the one for master just did not apply properly for the 4.12 branch for some reason.

Created attachment 8473
patch for master (add symlink to latest)

Modified patches to use "latest" instead of "last", like proposed by Simon.

Created attachment 8474
patch for xfce-4.12 (add symlink to latest)

Alexander Schwinn referenced this bugreport in commit 399090b197aee2cd98e3ba5c49a56632dd388eb8

Desktop icons order resets (Bug #11266) - Added link to last used configuration as fallback

https://git.xfce.org/xfce/xfdesktop/commit?id=399090b197aee2cd98e3ba5c49a56632dd388eb8

Alexander Schwinn referenced this bugreport in commit e8bf69ddd4bb7099cdb389ac6715c097b50d43aa

Desktop icons order resets (Bug #11266) - Added link to last used configuration as fallback

https://git.xfce.org/xfce/xfdesktop/commit?id=e8bf69ddd4bb7099cdb389ac6715c097b50d43aa

Pushed to master and 4.12 branch, to be released in 4.13.4 and 4.12.5 soon.

Changed in xfdesktop:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.