summaryrefslogtreecommitdiffstats
path: root/src/x11_in_qt4.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-03-19 14:33:04 +0000
committerDavid Robillard <d@drobilla.net>2013-03-19 14:33:04 +0000
commit003e60c4d9f34124acd482ce73b2c0af1912d13a (patch)
treecaee33d767677daf0e8bc047db8c250b01ee2731 /src/x11_in_qt4.cpp
parent0551bae284d3b860930e9feee3e267a8014f0a0b (diff)
downloadsuil-003e60c4d9f34124acd482ce73b2c0af1912d13a.tar.gz
suil-003e60c4d9f34124acd482ce73b2c0af1912d13a.tar.bz2
suil-003e60c4d9f34124acd482ce73b2c0af1912d13a.zip
Idle interface fixes for X11 in Qt4.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5094 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/x11_in_qt4.cpp')
-rw-r--r--src/x11_in_qt4.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/x11_in_qt4.cpp b/src/x11_in_qt4.cpp
index 495da68..152b371 100644
--- a/src/x11_in_qt4.cpp
+++ b/src/x11_in_qt4.cpp
@@ -14,8 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <QTimerEvent>
#include <QX11EmbedContainer>
+#include <QtEvents>
#undef signals
#include "./suil_config.h"
@@ -31,10 +31,12 @@ class SuilQX11Container : public QX11EmbedContainer
{
public:
SuilQX11Container(SuilInstance* instance,
- const LV2UI_Idle_Interface* idle_iface)
+ const LV2UI_Idle_Interface* idle_iface,
+ QX11EmbedWidget* widget)
: QX11EmbedContainer()
, _instance(instance)
, _idle_iface(idle_iface)
+ , _widget(widget)
, _ui_timer(0)
{}
@@ -42,6 +44,7 @@ public:
void showEvent(QShowEvent* event) {
if (_idle_iface && _ui_timer == 0) {
_ui_timer = this->startTimer(30);
+ _widget->embedInto(winId());
}
QX11EmbedContainer::showEvent(event);
}
@@ -54,9 +57,10 @@ public:
}
#endif
- SuilInstance* _instance;
- const LV2UI_Idle_Interface* _idle_iface;
- int _ui_timer;
+ SuilInstance* const _instance;
+ const LV2UI_Idle_Interface* const _idle_iface;
+ QX11EmbedWidget* const _widget;
+ int _ui_timer;
};
static int
@@ -69,12 +73,10 @@ wrapper_wrap(SuilWrapper* wrapper,
instance, LV2_UI__idleInterface);
#endif
- QX11EmbedWidget* const ew = (QX11EmbedWidget*)wrapper->impl;
- SuilQX11Container* const wrap = new SuilQX11Container(instance, idle_iface);
+ QX11EmbedWidget* const w = (QX11EmbedWidget*)wrapper->impl;
+ SuilQX11Container* const c = new SuilQX11Container(instance, idle_iface, w);
- ew->embedInto(wrap->winId());
-
- instance->host_widget = wrap;
+ instance->host_widget = c;
return 0;
}