diff options
author | David Robillard <d@drobilla.net> | 2015-09-17 16:18:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-09-17 16:18:42 +0000 |
commit | 501ac1f05f0b6ce3bceaa49775f83ebc8955e077 (patch) | |
tree | 792dafed47582e98a56dc2582fe1bb14946eccfc /src/gtk2_in_qt5.cpp | |
parent | ca1c65094684479ca756ba9351681f2e23d7afb7 (diff) | |
download | suil-501ac1f05f0b6ce3bceaa49775f83ebc8955e077.tar.gz suil-501ac1f05f0b6ce3bceaa49775f83ebc8955e077.tar.bz2 suil-501ac1f05f0b6ce3bceaa49775f83ebc8955e077.zip |
Fix issues with embedding in Qt.
Patch from Rui Nuno Capela.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5732 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gtk2_in_qt5.cpp')
-rw-r--r-- | src/gtk2_in_qt5.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gtk2_in_qt5.cpp b/src/gtk2_in_qt5.cpp index 6ebb8c7..e97f4a0 100644 --- a/src/gtk2_in_qt5.cpp +++ b/src/gtk2_in_qt5.cpp @@ -33,7 +33,7 @@ typedef struct _SuilGtk2InQt5Wrapper SuilGtk2InQt5Wrapper; struct _SuilGtk2InQt5Wrapper { QWidget* host_widget; - QWidget* parent; + QWindow* window; GtkWidget* plug; }; @@ -60,6 +60,11 @@ wrapper_free(SuilWrapper* wrapper) { SuilGtk2InQt5Wrapper* impl = (SuilGtk2InQt5Wrapper*)wrapper->impl; + if (impl->window) { + impl->window->setParent(NULL); + delete impl->window; + } + if (impl->plug) { gtk_widget_destroy(impl->plug); } @@ -107,6 +112,7 @@ wrapper_wrap(SuilWrapper* wrapper, G_OBJECT(plug), "size-allocate", G_CALLBACK(on_size_allocate), wrap); impl->host_widget = wrap; + impl->window = window; impl->plug = plug; instance->host_widget = wrap; @@ -141,13 +147,6 @@ suil_wrapper_new(SuilHost* host, SuilGtk2InQt5Wrapper* const impl = (SuilGtk2InQt5Wrapper*) calloc(1, sizeof(SuilGtk2InQt5Wrapper)); - /* Set parent widget if given. */ - for (unsigned i = 0; i < n_features; ++i) { - if (!strcmp((*features)[i]->URI, LV2_UI__parent)) { - impl->parent = static_cast<QWidget*>((*features)[i]->data); - } - } - SuilWrapper* wrapper = (SuilWrapper*)calloc(1, sizeof(SuilWrapper)); wrapper->wrap = wrapper_wrap; wrapper->free = wrapper_free; |