[Xfce4-commits] <xfce4-panel:devel> Add some debugging to external plugins.

Nick Schermer noreply at xfce.org
Mon Feb 1 17:02:02 CET 2010


Updating branch refs/heads/devel
         to 086959b70a5f129a5b878293689c80d86a485fcf (commit)
       from 70834c1e10adb0c54160011f0d46b6db276c51ab (commit)

commit 086959b70a5f129a5b878293689c80d86a485fcf
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 1 16:54:44 2010 +0100

    Add some debugging to external plugins.

 common/panel-debug.h          |    3 ++-
 panel/panel-plugin-external.c |   11 +++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/common/panel-debug.h b/common/panel-debug.h
index 8dc7955..32b7e00 100644
--- a/common/panel-debug.h
+++ b/common/panel-debug.h
@@ -22,6 +22,7 @@
 #define PANEL_DEBUG_DOMAIN_POSITIONING "positioning"
 #define PANEL_DEBUG_DOMAIN_STRUTS      "struts"
 #define PANEL_DEBUG_DOMAIN_APPLICATION "application"
+#define PANEL_DEBUG_DOMAIN_EXTERNAL    "external"
 
 #define PANEL_DEBUG_BOOL(bool) ((bool) ? "true" : "false")
 
@@ -29,6 +30,6 @@ extern gboolean panel_debug_enabled;
 
 void panel_debug (const gchar *domain,
                   const gchar *message,
-                  ...);
+                  ...) G_GNUC_PRINTF (2, 3);
 
 #endif /* !__PANEL_DEBUG_H__ */
diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c
index 82ded1f..154a80b 100644
--- a/panel/panel-plugin-external.c
+++ b/panel/panel-plugin-external.c
@@ -34,6 +34,7 @@
 
 #include <common/panel-private.h>
 #include <common/panel-dbus.h>
+#include <common/panel-debug.h>
 
 #include <libxfce4panel/libxfce4panel.h>
 #include <libxfce4panel/xfce-panel-plugin-provider.h>
@@ -296,6 +297,7 @@ panel_plugin_external_constructor (GType                  type,
       panel_return_val_if_fail (PANEL_PLUGIN_EXTERNAL (object)->unique_id != -1, NULL);
       path = g_strdup_printf (PANEL_DBUS_WRAPPER_PATH, PANEL_PLUGIN_EXTERNAL (object)->unique_id);
       dbus_g_connection_register_g_object (connection, path, object);
+      panel_debug (PANEL_DEBUG_DOMAIN_EXTERNAL, "register dbus path %s", path);
       g_free (path);
 
       dbus_g_connection_unref (connection);
@@ -439,8 +441,8 @@ panel_plugin_external_realize (GtkWidget *widget)
   argv = g_new0 (gchar *, argc + 1);
   argv[PLUGIN_ARGV_0] = (gchar *) WRAPPER_BIN;
   argv[PLUGIN_ARGV_FILENAME] = (gchar *) panel_module_get_filename (external->module);
-  argv[PLUGIN_ARGV_UNIQUE_ID] = (gchar *) unique_id;
-  argv[PLUGIN_ARGV_SOCKET_ID] = (gchar *) socket_id;
+  argv[PLUGIN_ARGV_UNIQUE_ID] = unique_id;
+  argv[PLUGIN_ARGV_SOCKET_ID] = socket_id;
   argv[PLUGIN_ARGV_NAME] = (gchar *) panel_module_get_name (external->module);
   argv[PLUGIN_ARGV_DISPLAY_NAME] = (gchar *) panel_module_get_display_name (external->module);
   argv[PLUGIN_ARGV_COMMENT] = (gchar *) panel_module_get_comment (external->module);
@@ -456,6 +458,11 @@ panel_plugin_external_realize (GtkWidget *widget)
                                  G_SPAWN_DO_NOT_REAP_CHILD, NULL,
                                  NULL, &pid, &error);
 
+  panel_debug (PANEL_DEBUG_DOMAIN_EXTERNAL,
+               "library=%s, unique-id=%s. socked-id=%s, argc=%d, pid=%d",
+               argv[PLUGIN_ARGV_FILENAME], unique_id,
+               socket_id, argc, pid);
+
   if (G_LIKELY (succeed))
     {
       /* watch the child */



More information about the Xfce4-commits mailing list