changeset 34126:72624e80fbce

Fix bug with option sub_window in the Win32 GUI. Enabling this option didn't work so far. Determine if we need a video window by using the same logic as in the X11/GTK GUI, and hide the subwindow accordingly. This also fixes the probably misunderstood use of GUI_SET_AUDIO in the Win32 GUI.
author ib
date Tue, 18 Oct 2011 12:45:24 +0000
parents a3c7ac76fac1
children 98f6d11e2ff3
files gui/win32/interface.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/interface.c	Tue Oct 18 11:03:39 2011 +0000
+++ b/gui/win32/interface.c	Tue Oct 18 12:45:24 2011 +0000
@@ -502,6 +502,7 @@
             if(!mygui->playlist->tracks) return 0;
             uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, STREAMTYPE_FILE);
             guiInfo.Track = mygui->playlist->current + 1;
+            guiInfo.VideoWindow = 1;
             if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
             if(gtkAOExtraStereo)
             {
@@ -536,11 +537,8 @@
         }
         case GUI_SET_AUDIO:
         {
-            guiInfo.VideoWindow = (data && !guiInfo.sh_video);
-            // NOTE: This type doesn't mean (and never meant) that we have
-            // *just* audio, so there probably should be a check before
-            // hiding (see gui/interface.c).
-            if(IsWindowVisible(mygui->subwindow))
+            if (data && !guiInfo.sh_video) guiInfo.VideoWindow = 0;
+            if(IsWindowVisible(mygui->subwindow) && !guiInfo.VideoWindow)
                 ShowWindow(mygui->subwindow, SW_HIDE);
             break;
         }