Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-02-04 10:59:57

piotr_go
Member
Registered: 2020-02-04
Posts: 4

Desktop icons rearrange themselves, FIX proposal.

Hi.

Desktop icons bug is present for years and nobody care to fix it.
https://wiki.archlinux.org/index.php/xf … themselves
Solution from the link above does not work for me.

I have an idea how to fix it (i hope smile ).
It's simple. Write icon positions to a file ONLY(!!!) when user moves icon by mouse or by clicking autoplacement (sorry, don't remember english name for this).

Best regards
Piotr

Offline

#2 2020-02-04 12:02:32

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,963

Re: Desktop icons rearrange themselves, FIX proposal.

piotr_go wrote:

Hi.

Hello and welcome.

Desktop icons bug is present for years and nobody care to fix it.

Which version of xfdesktop are you running? There were a number of fixes in 4.14 to address this issue (e.g. https://git.xfce.org/xfce/xfdesktop/com … 97b50d43aa). I haven't seen this issue in a while, but I have a simple set up on a laptop with a built-in intel graphics chip.

Personally, I think the answer is to change the icon placement logic from grid-based to a free-positioning model - but that requires someone to do the work.

Also have a read through this thread for more information and a possible workaround.

Offline

#3 2020-02-04 12:30:03

piotr_go
Member
Registered: 2020-02-04
Posts: 4

Re: Desktop icons rearrange themselves, FIX proposal.

xfdesktop4-4.14.1 from xubuntu 19.10
I also have Intel graphics.
XFCE with single panel on the bottom.

Offline

#4 2020-02-04 14:06:02

piotr_go
Member
Registered: 2020-02-04
Posts: 4

Re: Desktop icons rearrange themselves, FIX proposal.

I attached my patch. This should probably be done different way, but it's working.
Saving occurs only when user moves the icon.


diff -Nur xfdesktop4-4.14.1/src/xfdesktop-file-icon-manager.c xfdesktop4-4.14.1_/src/xfdesktop-file-icon-manager.c
--- xfdesktop4-4.14.1/src/xfdesktop-file-icon-manager.c    2019-05-19 22:13:01.000000000 +0200
+++ xfdesktop4-4.14.1_/src/xfdesktop-file-icon-manager.c    2020-02-04 11:31:06.283831629 +0100
@@ -2019,14 +2019,7 @@
xfdesktop_file_icon_position_changed(XfdesktopFileIcon *icon,
                                      gpointer user_data)
{
-    XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
-
-    if(fmanager->priv->save_icons_id)
-        g_source_remove(fmanager->priv->save_icons_id);

-    fmanager->priv->save_icons_id = g_timeout_add(SAVE_DELAY,
-                                                  xfdesktop_file_icon_manager_save_icons,
-                                                  fmanager);
}


@@ -2037,8 +2030,12 @@
{
     XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);

-    if(fmanager->priv->pending_icons == NULL)
-        xfdesktop_file_icon_position_changed(NULL, user_data);
+    if(fmanager->priv->save_icons_id)
+        g_source_remove(fmanager->priv->save_icons_id);
+
+    fmanager->priv->save_icons_id = g_timeout_add(SAVE_DELAY,
+                                                  xfdesktop_file_icon_manager_save_icons,
+                                                  fmanager);
}

gboolean
@@ -2531,7 +2528,7 @@
     if(fmanager->priv->save_icons_id) {
         g_source_remove(fmanager->priv->save_icons_id);
         fmanager->priv->save_icons_id = 0;
-        xfdesktop_file_icon_manager_save_icons(fmanager);
+        //xfdesktop_file_icon_manager_save_icons(fmanager);
     }

     /* ditch removable media */
@@ -3290,7 +3287,7 @@
     if(fmanager->priv->save_icons_id) {
         g_source_remove(fmanager->priv->save_icons_id);
         fmanager->priv->save_icons_id = 0;
-        xfdesktop_file_icon_manager_save_icons(fmanager);
+        //xfdesktop_file_icon_manager_save_icons(fmanager);
     }

     g_signal_handlers_disconnect_by_func(G_OBJECT(clipboard_manager),
diff -Nur xfdesktop4-4.14.1/src/xfdesktop-icon-view.c xfdesktop4-4.14.1_/src/xfdesktop-icon-view.c
--- xfdesktop4-4.14.1/src/xfdesktop-icon-view.c    2019-07-28 21:59:25.000000000 +0200
+++ xfdesktop4-4.14.1_/src/xfdesktop-icon-view.c    2020-02-04 11:28:52.247771382 +0100
@@ -1752,6 +1752,12 @@
             xfdesktop_icon_view_invalidate_icon(icon_view, l->data, TRUE);
         }

+        XfdesktopFileIconManager *fmanager = NULL;
+        if(XFDESKTOP_IS_FILE_ICON_MANAGER(icon_view->priv->manager))
+            fmanager = XFDESKTOP_FILE_ICON_MANAGER(icon_view->priv->manager);
+        if(fmanager != NULL)
+            xfdesktop_file_icon_save(fmanager);
+
         XF_DEBUG("drag succeeded");

         gtk_drag_finish(context, TRUE, FALSE, time_);
@@ -3234,7 +3240,7 @@
     if(fmanager == NULL)
         return;

-    xfdesktop_file_icon_save(fmanager);
+    //xfdesktop_file_icon_save(fmanager);

     /* add all cached icons back */
     for(l = icon_view->priv->pending_icons; l; l = l->next) {

Last edited by piotr_go (2020-02-04 14:08:59)

Offline

#5 2020-02-04 17:05:53

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,963

Re: Desktop icons rearrange themselves, FIX proposal.

You should create a bug report and attach your patch so the developers can test and comment on it.

Offline

#6 2020-02-04 18:32:23

piotr_go
Member
Registered: 2020-02-04
Posts: 4

Re: Desktop icons rearrange themselves, FIX proposal.

Bug report created.
https://bugzilla.xfce.org/show_bug.cgi?id=16425

When I searched my password for bugzilla i found that I reported icons rearrange bug 8+ years ago. big_smile
https://bugzilla.xfce.org/show_bug.cgi?id=8068
So... 8 more for solution?

Offline

#7 2020-02-04 18:47:22

Aravisian
Member
Registered: 2019-08-17
Posts: 406

Re: Desktop icons rearrange themselves, FIX proposal.

piotr_go wrote:

Bug report created.
https://bugzilla.xfce.org/show_bug.cgi?id=16425

When I searched my password for bugzilla i found that I reported icons rearrange bug 8+ years ago. big_smile
https://bugzilla.xfce.org/show_bug.cgi?id=8068
So... 8 more for solution?

No need to wait 8 years for a solution.
Just apply this patch I found on the internet:
https://forum.xfce.org/viewtopic.php?id=13734
big_smile


(Thanks for taking the time to work that patch out and offer it to others.)

Offline

Board footer

Powered by FluxBB