diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 200a202ff..c11300fd5 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -601,7 +601,7 @@ void ZynAddSubFxView::modelChanged() m_forwardMidiCC->setModel( &m->m_forwardMidiCcModel ); - toggleUI(); + m_toggleUIButton->setChecked( m->m_hasGUI ); } @@ -610,13 +610,16 @@ void ZynAddSubFxView::modelChanged() void ZynAddSubFxView::toggleUI() { ZynAddSubFxInstrument * model = castModel(); - model->m_hasGUI = m_toggleUIButton->isChecked(); - model->reloadPlugin(); - - if( model->m_remotePlugin ) + if( model->m_hasGUI != m_toggleUIButton->isChecked() ) { - connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ), - m_toggleUIButton, SLOT( toggle() ) ); + model->m_hasGUI = m_toggleUIButton->isChecked(); + model->reloadPlugin(); + + if( model->m_remotePlugin ) + { + connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ), + m_toggleUIButton, SLOT( toggle() ) ); + } } }