Skip to content

Commit

Permalink
X11EmbedContainer: Fix XEMBED protocol implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Sep 1, 2017
1 parent e661d26 commit adef05f
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 254 deletions.
16 changes: 3 additions & 13 deletions include/RemotePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,19 +787,6 @@ class EXPORT RemotePlugin : public QObject, public RemotePluginBase
unlock();
}

void showUI()
{
lock();
sendMessage( IdShowUI );
unlock();
}

void hideUI()
{
lock();
sendMessage( IdHideUI );
unlock();
}

inline bool failed() const
{
Expand All @@ -816,6 +803,9 @@ class EXPORT RemotePlugin : public QObject, public RemotePluginBase
m_commMutex.unlock();
}

public slots:
void showUI();
void hideUI();

protected:
inline void setSplittedChannels( bool _on )
Expand Down
8 changes: 5 additions & 3 deletions plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ bool RemoteVstPlugin::processMessage( const message & _m )
break;
}

case IdShowUI:
ShowWindow( m_window, SW_SHOWNORMAL );
UpdateWindow( m_window );
break;

default:
return RemotePluginClient::processMessage( _m );
}
Expand Down Expand Up @@ -687,9 +692,6 @@ void RemoteVstPlugin::initEditor()
SWP_NOMOVE | SWP_NOZORDER );
pluginDispatch( effEditTop );

ShowWindow( m_window, SW_SHOWNORMAL );
UpdateWindow( m_window );

#ifdef LMMS_BUILD_LINUX
m_windowID = (intptr_t) GetProp( m_window, "__wine_x11_whole_window" );
#endif
Expand Down
24 changes: 10 additions & 14 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,35 +229,31 @@ void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
return;
}

m_pluginWidget = new QWidget( _parent );
QX11EmbedContainer * xe = new QX11EmbedContainer;
m_pluginWidget = xe;
m_pluginWidget->setFixedSize( m_pluginGeometry );
m_pluginWidget->setWindowTitle( name() );

connect(xe, SIGNAL(clientIsEmbedded()), this, SLOT(showUI()));

if( _parent == NULL )
{
vstSubWin * sw = new vstSubWin(
gui->mainWindow()->workspace() );
sw->setWidget( m_pluginWidget );

if( isEffect )
{
sw->setAttribute( Qt::WA_TranslucentBackground );
sw->setWindowFlags( Qt::FramelessWindowHint );
sw->setWidget( m_pluginWidget );
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->show();
}
}
else
{
sw->setWindowFlags( Qt::WindowCloseButtonHint );
sw->setWidget( m_pluginWidget );

QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->move( 4, 24 );
xe->show();
}
}
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );

#endif

Expand Down
14 changes: 14 additions & 0 deletions src/core/RemotePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,20 @@ void RemotePlugin::processMidiEvent( const MidiEvent & _e,
unlock();
}

void RemotePlugin::showUI()
{
lock();
sendMessage( IdShowUI );
unlock();
}

void RemotePlugin::hideUI()
{
lock();
sendMessage( IdHideUI );
unlock();
}




Expand Down
5 changes: 4 additions & 1 deletion src/gui/SubWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ void SubWindow::paintEvent( QPaintEvent * )
{
QPainter p( this );
QRect rect( 0, 0, width(), m_titleBarHeight );
bool isActive = SubWindow::mdiArea()->activeSubWindow() == this;

bool isActive = mdiArea()
? mdiArea()->activeSubWindow() == this
: false;

p.fillRect( rect, isActive ? activeColor() : p.pen().brush() );

Expand Down
Loading

0 comments on commit adef05f

Please sign in to comment.