Skip to content

Commit b808631

Browse files
lukas-wPhysSong
authored andcommitted
VST: Add workaround for small effect window on project load
1 parent 8e9f74d commit b808631

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

plugins/VstEffect/VstEffectControlDialog.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <QToolBar>
4242
#include <QLabel>
4343

44-
4544
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
4645
EffectControlDialog( _ctl ),
4746
m_pluginWidget( NULL ),
@@ -274,6 +273,17 @@ void VstEffectControlDialog::paintEvent( QPaintEvent * )
274273
}
275274
}
276275

276+
void VstEffectControlDialog::showEvent(QShowEvent *_se)
277+
{
278+
EffectControlDialog::showEvent( _se );
279+
// Workaround for a (unexplained) bug where on project-load the effect
280+
// control window has size 0 and would only restore to the proper size upon
281+
// moving the window or interacting with it.
282+
if (parentWidget()) {
283+
parentWidget()->adjustSize();
284+
}
285+
}
286+
277287

278288

279289

plugins/VstEffect/VstEffectControlDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class VstEffectControlDialog : public EffectControlDialog
5050

5151
protected:
5252
virtual void paintEvent( QPaintEvent * _pe );
53+
virtual void showEvent( QShowEvent* _se ) override;
5354

5455
private:
5556
QWidget * m_pluginWidget;

0 commit comments

Comments
 (0)