Skip to content

Commit

Permalink
Keep non-embedded VSTs on top on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark committed Apr 29, 2018
1 parent 93cfb1d commit 4d27863
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include <QMdiSubWindow>

#ifdef LMMS_BUILD_LINUX
# include <QX11Info>
# if QT_VERSION < 0x050000
# include <QX11EmbedContainer>
# include <QX11Info>
# else
# include "X11EmbedContainer.h"
# include <QWindow>
Expand All @@ -62,6 +62,10 @@
#include "templates.h"
#include "FileDialog.h"

#ifdef LMMS_BUILD_LINUX
# include <X11/Xlib.h>
#endif


VstPlugin::VstPlugin( const QString & _plugin ) :
m_plugin( _plugin ),
Expand Down Expand Up @@ -324,16 +328,22 @@ bool VstPlugin::processMessage( const message & _m )

case IdVstPluginWindowID:
m_pluginWindowID = _m.getInt();
#ifdef LMMS_BUILD_WIN32
if( m_embedMethod == "none" )
{
#ifdef LMMS_BUILD_WIN32
// We're changing the owner, not the parent,
// so this is legal despite MSDN's warning
SetWindowLongPtr( (HWND)(intptr_t) m_pluginWindowID,
GWLP_HWNDPARENT,
(LONG_PTR) gui->mainWindow()->winId() );
}
#endif

#ifdef LMMS_BUILD_LINUX
XSetTransientForHint( QX11Info::display(),
m_pluginWindowID,
gui->mainWindow()->winId() );
#endif
}
break;

case IdVstPluginEditorGeometry:
Expand Down

0 comments on commit 4d27863

Please sign in to comment.