diff src/aosd/aosd_ui.c @ 883:e6d51d079a46 trunk

[svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
author giacomo
date Tue, 20 Mar 2007 18:55:57 -0700
parents 153bb82ff081
children ca9907354db6
line wrap: on
line diff
--- a/src/aosd/aosd_ui.c	Tue Mar 20 14:01:54 2007 -0700
+++ b/src/aosd/aosd_ui.c	Tue Mar 20 18:55:57 2007 -0700
@@ -30,6 +30,7 @@
 
 
 extern aosd_cfg_t * global_config;
+extern gboolean plugin_is_active;
 
 
 /*************************************************************/
@@ -771,7 +772,9 @@
 #endif
   markup_message = g_markup_printf_escaped(
     "<span font_desc='%s'>Audacious OSD</span>" , cfg->osd->text.fonts_name[0] );
-  aosd_display( markup_message , cfg->osd , TRUE );
+  if ( plugin_is_active != TRUE )
+    aosd_osd_init();
+  aosd_osd_display( markup_message , cfg->osd , TRUE );
   g_free( markup_message );
   aosd_cfg_delete( cfg );
   return;
@@ -783,7 +786,9 @@
 {
   GList *cb_list = g_object_get_data( G_OBJECT(cfg_win) , "cblist" );
   aosd_callback_list_free( cb_list );
-  aosd_shutdown(); /* stop any displayed osd */
+  aosd_osd_shutdown(); /* stop any displayed osd */
+  if ( plugin_is_active != TRUE )
+    aosd_osd_cleanup();
   gtk_widget_destroy( GTK_WIDGET(cfg_win) );
   return;
 }
@@ -797,7 +802,10 @@
   GList *cb_list = g_object_get_data( G_OBJECT(cfg_win) , "cblist" );
   aosd_callback_list_run( cb_list , cfg );
   cfg->set = TRUE;
-  aosd_shutdown(); /* stop any displayed osd */
+  aosd_osd_shutdown(); /* stop any displayed osd */
+  if ( plugin_is_active != TRUE )
+    aosd_osd_cleanup();
+
   if ( global_config != NULL )
   {
     /* plugin is active */