changeset 914:d12d27887bf0 trunk

[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
author giacomo
date Wed, 04 Apr 2007 11:49:12 -0700
parents 4fbe6bd78021
children 1ccc7a9c7fc2
files ChangeLog src/statusicon/si.c src/statusicon/si_common.h
diffstat 3 files changed, 22 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 04 10:53:50 2007 -0700
+++ b/ChangeLog	Wed Apr 04 11:49:12 2007 -0700
@@ -1,3 +1,10 @@
+2007-04-04 17:53:50 +0000  Giacomo Lozito <james@develia.org>
+  revision [1926]
+  - aosd: small changes
+  trunk/src/aosd/aosd_ui.c |   10 ++++++----
+  1 file changed, 6 insertions(+), 4 deletions(-)
+
+
 2007-04-04 17:52:15 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1924]
   - patches from upstream TTA author. see http://boards.nenolod.net/viewtopic.php?t=375
--- a/src/statusicon/si.c	Wed Apr 04 10:53:50 2007 -0700
+++ b/src/statusicon/si.c	Wed Apr 04 11:49:12 2007 -0700
@@ -84,17 +84,23 @@
 void
 si_audacious_toggle_visibility ( void )
 {
+  static gboolean mw_prevstatus = FALSE;
   static gboolean eq_prevstatus = FALSE;
   static gboolean pl_prevstatus = FALSE;
 
-  /* use the main window visibility status to toggle show/hide */
-  if ( xmms_remote_is_main_win( si_gp.xmms_session ) == TRUE )
+  /* use the window visibility status to toggle show/hide
+     (if at least one is visible, hide) */
+  if (( xmms_remote_is_main_win( si_gp.xmms_session ) == TRUE ) ||
+      ( xmms_remote_is_eq_win( si_gp.xmms_session ) == TRUE ) ||
+      ( xmms_remote_is_pl_win( si_gp.xmms_session ) == TRUE ))
   {
-    /* remember the visibility status of equalizer and playlist windows */
+    /* remember the visibility status of the player windows */
+    mw_prevstatus = xmms_remote_is_main_win( si_gp.xmms_session );
     eq_prevstatus = xmms_remote_is_eq_win( si_gp.xmms_session );
     pl_prevstatus = xmms_remote_is_pl_win( si_gp.xmms_session );
-    /* now hide all of the player windows */
-    xmms_remote_main_win_toggle( si_gp.xmms_session , FALSE );
+    /* now hide all of them */
+    if ( mw_prevstatus == TRUE )
+      xmms_remote_main_win_toggle( si_gp.xmms_session , FALSE );
     if ( eq_prevstatus == TRUE )
       xmms_remote_eq_win_toggle( si_gp.xmms_session , FALSE );
     if ( pl_prevstatus == TRUE )
@@ -102,9 +108,9 @@
   }
   else
   {
-    /* show the main player window again */
-    xmms_remote_main_win_toggle( si_gp.xmms_session , TRUE );
-    /* show the equalizer and playlist window if they were visible before */
+    /* show the windows that were visible before */
+    if ( mw_prevstatus == TRUE )
+      xmms_remote_main_win_toggle( si_gp.xmms_session , TRUE );
     if ( eq_prevstatus == TRUE )
       xmms_remote_eq_win_toggle( si_gp.xmms_session , TRUE );
     if ( pl_prevstatus == TRUE )
--- a/src/statusicon/si_common.h	Wed Apr 04 10:53:50 2007 -0700
+++ b/src/statusicon/si_common.h	Wed Apr 04 11:49:12 2007 -0700
@@ -30,6 +30,6 @@
 
 #include "../../config.h"
 
-#define SI_VERSION_PLUGIN "0.3"
+#define SI_VERSION_PLUGIN "0.4"
 
 #endif /* !_I_ED_COMMON_H */