[Xfce4-commits] <xfce4-settings:master> Add some debugging to workspaces object.

Nick Schermer noreply at xfce.org
Mon Feb 28 17:16:17 CET 2011


Updating branch refs/heads/master
         to 9c1e3933788694bf72bdb5da852edf8bb7445c44 (commit)
       from 51fe5c7e68b30bcc55752feb2c3e0057f0b2108c (commit)

commit 9c1e3933788694bf72bdb5da852edf8bb7445c44
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Feb 25 09:44:38 2011 +0100

    Add some debugging to workspaces object.

 xfsettingsd/debug.c      |    1 +
 xfsettingsd/debug.h      |    1 +
 xfsettingsd/workspaces.c |   15 ++++++++++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/xfsettingsd/debug.c b/xfsettingsd/debug.c
index 477c53c..43eae4b 100644
--- a/xfsettingsd/debug.c
+++ b/xfsettingsd/debug.c
@@ -37,6 +37,7 @@ static const GDebugKey dbg_keys[] =
     { "keyboard-layout", XFSD_DEBUG_KEYBOARD_LAYOUT },
     { "keyboards", XFSD_DEBUG_KEYBOARDS },
     { "keyboard-shortcuts", XFSD_DEBUG_KEYBOARD_SHORTCUTS },
+    { "workspaces", XFSD_DEBUG_WORKSPACES },
 };
 
 
diff --git a/xfsettingsd/debug.h b/xfsettingsd/debug.h
index 68d7f07..ff743ec 100644
--- a/xfsettingsd/debug.h
+++ b/xfsettingsd/debug.h
@@ -29,6 +29,7 @@ typedef enum
    XFSD_DEBUG_KEYBOARD_LAYOUT    = 1 << 3,
    XFSD_DEBUG_KEYBOARDS          = 1 << 4,
    XFSD_DEBUG_KEYBOARD_SHORTCUTS = 1 << 5,
+   XFSD_DEBUG_WORKSPACES         = 1 << 6,
 }
 XfsdDebugDomain;
 
diff --git a/xfsettingsd/workspaces.c b/xfsettingsd/workspaces.c
index 42eb9ac..9fa18c0 100644
--- a/xfsettingsd/workspaces.c
+++ b/xfsettingsd/workspaces.c
@@ -33,6 +33,7 @@
 #include <gdk/gdkx.h>
 #endif
 
+#include "debug.h"
 #include "workspaces.h"
 
 #define WORKSPACES_CHANNEL    "xfwm4"
@@ -147,6 +148,8 @@ xfce_workspaces_helper_filter_func (GdkXEvent  *gdkxevent,
         {
             /* new workspace was added or removed */
             xfce_workspaces_helper_set_names (helper);
+
+            xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "number of desktops changed");
         }
         else if (xevent->xproperty.atom == atom_net_desktop_names)
         {
@@ -160,6 +163,8 @@ xfce_workspaces_helper_filter_func (GdkXEvent  *gdkxevent,
                  * not update xfconf) the name of a desktop, store the
                  * new names in xfconf if different*/
                 xfce_workspaces_helper_save_names (helper);
+
+                xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "someone else changed the desktop names");
             }
         }
     }
@@ -322,6 +327,8 @@ xfce_workspaces_helper_set_names (XfceWorkspacesHelper *helper)
         if (gdk_error_trap_pop () != 0)
             g_warning ("Failed to change _NET_DESKTOP_NAMES.");
 
+        xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "%d desktop names set from xfconf", i);
+
         g_string_free (names_str, TRUE);
     }
     else
@@ -364,6 +371,8 @@ xfce_workspaces_helper_set_names (XfceWorkspacesHelper *helper)
         if (!xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, names))
              g_critical ("Failed to save xfconf property %s", WORKSPACE_NAMES_PROP);
 
+        xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "extended names in xfconf, waiting for property-change");
+
         xfconf_array_free (existing_names);
     }
 
@@ -396,6 +405,8 @@ xfce_workspaces_helper_save_names (XfceWorkspacesHelper *helper)
          * we probably saved (and set) a name when the workspace count
          * was changed */
         xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, new_names);
+
+        xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "storing %d names in xfconf", new_names->len);
     }
     else if (xfconf_names != NULL
              && xfconf_names->len >= new_names->len)
@@ -421,7 +432,9 @@ xfce_workspaces_helper_save_names (XfceWorkspacesHelper *helper)
         if (save_array)
         {
             xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, xfconf_names);
-            g_message ("Saved new workspace names in xfconf.");
+
+            xfsettings_dbg (XFSD_DEBUG_WORKSPACES, "merged %d xfconf and %d desktop names",
+                            xfconf_names->len, new_names->len);
         }
     }
 



More information about the Xfce4-commits mailing list