diff options
author | David Robillard <d@drobilla.net> | 2017-02-26 12:28:40 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-26 12:28:40 +0100 |
commit | 176e3c9146d01d35b871b7a00e3c8c2482b008ec (patch) | |
tree | 4c9113cd7d944208b974613a6c45da85dca0a884 /src | |
parent | 96d838c1f4af144da1506b4df10f16057417cbab (diff) | |
download | suil-176e3c9146d01d35b871b7a00e3c8c2482b008ec.tar.gz suil-176e3c9146d01d35b871b7a00e3c8c2482b008ec.tar.bz2 suil-176e3c9146d01d35b871b7a00e3c8c2482b008ec.zip |
Add preliminary Qt5 in Gtk2 support
This crashes virtually all of the time in straight Gtk hosts unless
XInitThreads is called before any Gtk functions. A portable solution to this
is needed, but I have no idea what that might be.
Diffstat (limited to 'src')
-rw-r--r-- | src/instance.c | 10 | ||||
-rw-r--r-- | src/qt4_in_gtk2.cpp | 16 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/instance.c b/src/instance.c index 29ff3f9..f05cc86 100644 --- a/src/instance.c +++ b/src/instance.c @@ -1,5 +1,5 @@ /* - Copyright 2007-2015 David Robillard <http://drobilla.net> + Copyright 2007-2017 David Robillard <http://drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -44,6 +44,8 @@ suil_ui_supported(const char* container_type_uri, return SUIL_WRAPPING_NATIVE; } else if ((!strcmp(container_type_uri, GTK2_UI_URI) && !strcmp(ui_type_uri, QT4_UI_URI)) + || (!strcmp(container_type_uri, GTK2_UI_URI) + && !strcmp(ui_type_uri, QT5_UI_URI)) || (!strcmp(container_type_uri, QT4_UI_URI) && !strcmp(ui_type_uri, GTK2_UI_URI)) || (!strcmp(container_type_uri, QT5_UI_URI) @@ -92,6 +94,12 @@ open_wrapper(SuilHost* host, module_name = "suil_qt4_in_gtk2"; } #endif +#ifdef SUIL_WITH_QT5_IN_GTK2 + if (!strcmp(container_type_uri, GTK2_UI_URI) + && !strcmp(ui_type_uri, QT5_UI_URI)) { + module_name = "suil_qt5_in_gtk2"; + } +#endif #ifdef SUIL_WITH_X11_IN_GTK2 if (!strcmp(container_type_uri, GTK2_UI_URI) && !strcmp(ui_type_uri, X11_UI_URI)) { diff --git a/src/qt4_in_gtk2.cpp b/src/qt4_in_gtk2.cpp index 423c5bc..443c8f0 100644 --- a/src/qt4_in_gtk2.cpp +++ b/src/qt4_in_gtk2.cpp @@ -1,5 +1,5 @@ /* - Copyright 2011-2015 David Robillard <http://drobilla.net> + Copyright 2011-2017 David Robillard <http://drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -17,8 +17,8 @@ #include <gtk/gtk.h> #include <QApplication> -#include <QX11EmbedWidget> #include <QVBoxLayout> +#include <QX11EmbedWidget> #include "./suil_internal.h" @@ -57,10 +57,9 @@ suil_qt_wrapper_finalize(GObject* gobject) } delete self->qembed; - self->qembed = NULL; - - self->app = NULL; + self->qembed = NULL; + self->app = NULL; self->wrapper->impl = NULL; G_OBJECT_CLASS(suil_qt_wrapper_parent_class)->finalize(gobject); @@ -108,10 +107,8 @@ wrapper_wrap(SuilWrapper* wrapper, qwidget->setParent(wrap->qembed); - g_signal_connect_after(G_OBJECT(wrap), - "realize", - G_CALLBACK(suil_qt_wrapper_realize), - NULL); + g_signal_connect_after(G_OBJECT(wrap), "realize", + G_CALLBACK(suil_qt_wrapper_realize), NULL); instance->host_widget = GTK_WIDGET(wrap); @@ -150,7 +147,6 @@ suil_wrapper_new(SuilHost* host, } wrap->wrapper = NULL; - wrapper->impl = wrap; return wrapper; |