diff --git a/src/toolbars/ToolManager.cpp b/src/toolbars/ToolManager.cpp index bb7f856a3..dca67db9a 100644 --- a/src/toolbars/ToolManager.cpp +++ b/src/toolbars/ToolManager.cpp @@ -475,6 +475,7 @@ void ToolManager::Reset() wxWindow *floater; ToolDock *dock; ToolBar *bar = mBars[ ndx ]; + bool expose = true; // Disconnect the bar if( bar->IsDocked() ) @@ -487,21 +488,17 @@ void ToolManager::Reset() floater = bar->GetParent(); } - if (ndx == SelectionBarID ) + if (ndx == SelectionBarID +#ifdef EXPERIMENTAL_SPECTRAL_EDITING + || ndx == SpectralSelectionBarID +#endif + ) { dock = mBotDock; wxCommandEvent e; bar->GetEventHandler()->ProcessEvent(e); } - else if( ndx == MeterBarID -#ifdef EXPERIMENTAL_SPECTRAL_EDITING - || ndx == SpectralSelectionBarID -#endif - ) - { - dock = NULL; - } else { dock = mTopDock; @@ -516,11 +513,20 @@ void ToolManager::Reset() } #endif + if( ndx == MeterBarID +#ifdef EXPERIMENTAL_SPECTRAL_EDITING + || ndx == SpectralSelectionBarID +#endif + ) + { + expose = false; + } + if( dock != NULL ) { // when we dock, we reparent, so bar is no longer a child of floater. dock->Dock( bar ); - Expose( ndx, true ); + Expose( ndx, expose ); //OK (and good) to delete floater, as bar is no longer in it. if( floater ) floater->Destroy();