[Xfce4-commits] <xfce4-indicator-plugin:master> Worked around crashes when plugin is loaded as an external plugin.

Andrzej noreply at xfce.org
Thu Apr 4 17:44:19 CEST 2013


Updating branch refs/heads/master
         to 707ad099934c2e3ff7aab18c0601b6072e23f782 (commit)
       from 00633e1de8308a1456a46f8dc03f7baa2a62c30a (commit)

commit 707ad099934c2e3ff7aab18c0601b6072e23f782
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Dec 2 21:34:37 2012 +0000

    Worked around crashes when plugin is loaded as an external plugin.
    
    The plugin used to crash when xfce4-panel was compiled with
    --enable-debug and the plugin was configured as an external module
    (X-XFCE-Internal=FALSE in indicator.desktop file).
    
    This was caused by the wrapper binary setting a more restrictive
    fatal mask than the xfce4-panel binary. As we are linking external
    code (indicators) we have no control over their use of g_warning or
    g_critical.
    
    This commit relaxes the fatal mask so that the use of g_warning or
    g_critical does not crash the plugin.

 panel-plugin/indicator.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e807328..47c5e1b 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -178,6 +178,12 @@ indicator_init (IndicatorPlugin *indicator)
 {
   XfcePanelPlugin  *plugin = XFCE_PANEL_PLUGIN (indicator);
 
+  /* Indicators print a lot of warnings. By default, "wrapper"
+     makes them critical, so the plugin "crashes" when run as an external
+     plugin but not internal one (loaded by "xfce4-panel" itself).
+     The following lines makes only g_error critical. */
+  g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+
   indicator->buttonbox = xfce_indicator_box_new (plugin);
   gtk_container_add (GTK_CONTAINER (plugin), GTK_WIDGET(indicator->buttonbox));
   gtk_widget_show(GTK_WIDGET(indicator->buttonbox));


More information about the Xfce4-commits mailing list