[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix icon position saving on resolution change (Bug 10813)

noreply at xfce.org noreply at xfce.org
Sun Apr 20 16:34:30 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit 310e8cf0faae87124247ab55e8fb46dd3deb1f00
Author: Mauro Giubileo <debianmaverick at gmail.com>
Date:   Sun Apr 20 17:32:31 2014 +0300

    Fix icon position saving on resolution change (Bug 10813)
    
    This patch does the following:
     1) Alter the SAVE_DELAY factor from 7 seconds to 1 second, so that when you
        change/move some icon on the desktop, you don't have to wait 7 seconds
        before xfdesktop saves the icons and you can safely logout.
     2) When you change your screen resolution with one never used so far,
        now xfdesktop will save your icon positions even if you don't change
        the icons positions.
    
    Signed-off-by: Eric Koegel <eric.koegel at gmail.com>
---
 src/xfdesktop-file-icon-manager.c |    8 +++++++-
 src/xfdesktop-file-icon-manager.h |    2 ++
 src/xfdesktop-icon-view.c         |    2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 83f1bae..9f50632 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -76,7 +76,7 @@
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
 
-#define SAVE_DELAY  7000
+#define SAVE_DELAY  1000
 #define BORDER         8
 
 typedef enum
@@ -1828,6 +1828,12 @@ xfdesktop_file_icon_position_changed(XfdesktopFileIcon *icon,
 
 /*   *****   */
 
+void
+xfdesktop_file_icon_save(gpointer user_data)
+{
+	xfdesktop_file_icon_position_changed(NULL, user_data);
+}
+
 gboolean
 xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *fmanager,
                                                      const gchar *name,
diff --git a/src/xfdesktop-file-icon-manager.h b/src/xfdesktop-file-icon-manager.h
index 847f573..1317287 100644
--- a/src/xfdesktop-file-icon-manager.h
+++ b/src/xfdesktop-file-icon-manager.h
@@ -55,6 +55,8 @@ GType xfdesktop_file_icon_manager_get_type(void) G_GNUC_CONST;
 XfdesktopIconViewManager *xfdesktop_file_icon_manager_new(GFile *folder,
                                                           XfconfChannel *channel);
 
+void xfdesktop_file_icon_save(gpointer user_data);
+
 gboolean xfdesktop_file_icon_manager_get_cached_icon_position(
                                                     XfdesktopFileIconManager *fmanager,
                                                     const gchar *name,
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index d3c4ebc..b9b325b 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -3258,6 +3258,8 @@ xfdesktop_move_all_cached_icons_to_desktop(XfdesktopIconView *icon_view)
     if(fmanager == NULL)
         return;
 
+    xfdesktop_file_icon_save(fmanager);
+
     /* add all cached icons back */
     for(l = icon_view->priv->pending_icons; l; l = l->next) {
         gint16 row, col;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list