summaryrefslogtreecommitdiffstats
path: root/src/gtk2_in_qt5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtk2_in_qt5.cpp')
-rw-r--r--src/gtk2_in_qt5.cpp15
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;