diff options
author | rncbc <rncbc@rncbc.org> | 2018-12-11 09:53:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-12-19 20:24:55 -0500 |
commit | 8d507420c0e91ed704b692187f9962d7fcf0e15f (patch) | |
tree | 8b907d7b19b93f7facd90231af6e658da1f3e2c1 | |
parent | 9a93d3c3b9ffe7ff7fe2602d0523d4f80655e8aa (diff) | |
download | suil-8d507420c0e91ed704b692187f9962d7fcf0e15f.tar.gz suil-8d507420c0e91ed704b692187f9962d7fcf0e15f.tar.bz2 suil-8d507420c0e91ed704b692187f9962d7fcf0e15f.zip |
Fix qt5_in_gtk2 wrapper
Removes the built-in QApplication instantiation and postpones the deletion of
the embedded QWidget. This makes UIs work more nicely in hosts like Ardour.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/qt5_in_gtk2.cpp | 14 |
2 files changed, 5 insertions, 12 deletions
@@ -2,8 +2,9 @@ suil (0.10.1) unstable; * Add support for Cocoa in Qt5 * Fix resizing and add idle and update rate support for Qt5 in Gtk2 + * Fix various issues with Qt5 in Gtk2 - -- David Robillard <d@drobilla.net> Tue, 03 Oct 2017 22:11:49 +0200 + -- David Robillard <d@drobilla.net> Wed, 19 Dec 2018 20:24:50 -0500 suil (0.10.0) stable; diff --git a/src/qt5_in_gtk2.cpp b/src/qt5_in_gtk2.cpp index f0e324a..4c77c4d 100644 --- a/src/qt5_in_gtk2.cpp +++ b/src/qt5_in_gtk2.cpp @@ -17,7 +17,6 @@ #include <gtk/gtk.h> -#include <QApplication> #include <QVBoxLayout> #include <QWidget> #include <QWindow> @@ -37,7 +36,6 @@ typedef struct _SuilQtWrapperClass SuilQtWrapperClass; struct _SuilQtWrapper { GtkSocket socket; - QApplication* app; QWidget* qembed; SuilWrapper* wrapper; SuilInstance* instance; @@ -69,10 +67,11 @@ suil_qt_wrapper_finalize(GObject* gobject) self->instance->handle = NULL; } - delete self->qembed; + if (self->qembed) { + self->qembed->deleteLater(); + } self->qembed = NULL; - self->app = NULL; self->idle_iface = NULL; self->wrapper->impl = NULL; @@ -90,7 +89,6 @@ suil_qt_wrapper_class_init(SuilQtWrapperClass* klass) static void suil_qt_wrapper_init(SuilQtWrapper* self) { - self->app = NULL; self->qembed = NULL; self->wrapper = NULL; self->instance = NULL; @@ -194,12 +192,6 @@ suil_wrapper_new(SuilHost* host, SuilQtWrapper* const wrap = SUIL_QT_WRAPPER( g_object_new(SUIL_TYPE_QT_WRAPPER, NULL)); - if (qApp) { - wrap->app = qApp; - } else { - wrap->app = new QApplication(host->argc, host->argv, true); - } - wrap->wrapper = NULL; wrapper->impl = wrap; |