[Xfce4-commits] <xfce4-panel:master> Add some debugging support for 4.6 plugins.

Nick Schermer noreply at xfce.org
Mon May 10 23:24:01 CEST 2010


Updating branch refs/heads/master
         to ce7659a4712eeb941c9cd16c050bf0a2b4a0a704 (commit)
       from 5714d3af6c0281917462f36494edf8c18bb8d18e (commit)

commit ce7659a4712eeb941c9cd16c050bf0a2b4a0a704
Author: Nick Schermer <nick at xfce.org>
Date:   Mon May 10 23:22:07 2010 +0200

    Add some debugging support for 4.6 plugins.

 libxfce4panel/xfce-panel-macros-46.h |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/libxfce4panel/xfce-panel-macros-46.h b/libxfce4panel/xfce-panel-macros-46.h
index 482f614..16c93c3 100644
--- a/libxfce4panel/xfce-panel-macros-46.h
+++ b/libxfce4panel/xfce-panel-macros-46.h
@@ -283,6 +283,7 @@ enum /*< skip >*/
   static GdkColor         _xpp_bg_color = { 0, }; \
   static const gchar     *_xpp_bg_image = NULL; \
   static cairo_pattern_t *_xpp_bg_image_cache = NULL; \
+  static gboolean         _xpp_debug = FALSE; \
   \
   static void \
   _xpp_quit_main_loop (void) \
@@ -398,10 +399,14 @@ enum /*< skip >*/
     \
     g_return_if_fail (GTK_IS_PLUG (plug)); \
     g_return_if_fail (XFCE_IS_PANEL_PLUGIN (xpp)); \
-    g_return_if_fail (GDK_IS_WINDOW (gtk_widget_get_window (plug))); \
+    g_return_if_fail (GTK_WIDGET_REALIZED (plug)); \
     g_return_if_fail (_xpp_atom != GDK_NONE); \
     g_return_if_fail (GTK_WIDGET_REALIZED (xpp)); \
     \
+    if (_xpp_debug) \
+      g_printerr ("xfce4-panel(%s): send provider signal %d\n", \
+                  xfce_panel_plugin_get_name (xpp), message); \
+    \
     event.type = GDK_CLIENT_EVENT; \
     event.window = gtk_widget_get_window (plug); \
     event.send_event = TRUE; \
@@ -427,6 +432,11 @@ enum /*< skip >*/
   { \
     g_return_if_fail (XFCE_IS_PANEL_PLUGIN (xpp)); \
     g_return_if_fail (GTK_IS_PLUG (plug)); \
+    g_return_if_fail (GTK_WIDGET_REALIZED (plug)); \
+    \
+    if (_xpp_debug) \
+      g_printerr ("xfce4-panel(%s): calling plugin construct function\n", \
+                  xfce_panel_plugin_get_name (xpp)); \
     \
     g_signal_handlers_disconnect_by_func (G_OBJECT (xpp), \
         G_CALLBACK (_xpp_realize), NULL); \
@@ -535,6 +545,7 @@ enum /*< skip >*/
     gint             unique_id; \
     GdkNativeWindow  socket_id; \
     GdkColormap     *colormap = NULL; \
+    const gchar     *value; \
     \
     if (G_UNLIKELY (argc < PLUGIN_ARGV_ARGUMENTS)) \
       { \
@@ -542,6 +553,10 @@ enum /*< skip >*/
         return PLUGIN_EXIT_FAILURE; \
       } \
     \
+    value = g_getenv ("PANEL_DEBUG"); \
+    if (value != NULL && value[0] == '1' && value[1] == '\0') \
+      _xpp_debug = TRUE; \
+    \
     if (G_UNLIKELY (preinit_func != NULL)) \
       { \
         if (!((XfcePanelPluginPreInit) preinit_func) (argc, argv)) \



More information about the Xfce4-commits mailing list