diff options
author | David Robillard <d@drobilla.net> | 2011-05-30 23:17:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-30 23:17:07 +0000 |
commit | 02fe4df201838c381d4106ec92849cbb5b959ccb (patch) | |
tree | a1fd9c1548967eb7c4ff01d3f4910a3ccb32898a | |
parent | e719233aed509cd3b15e4ee3c5f7f268b030b541 (diff) | |
download | suil-02fe4df201838c381d4106ec92849cbb5b959ccb.tar.gz suil-02fe4df201838c381d4106ec92849cbb5b959ccb.tar.bz2 suil-02fe4df201838c381d4106ec92849cbb5b959ccb.zip |
Initialise Gtk when wrapped in Qt, and initialise GtkPlug with QX11EmbedContainer's X11 ID.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@3343 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/gtk2_in_qt4.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gtk2_in_qt4.cpp b/src/gtk2_in_qt4.cpp index 2d18df7..91fa3b1 100644 --- a/src/gtk2_in_qt4.cpp +++ b/src/gtk2_in_qt4.cpp @@ -30,7 +30,7 @@ suil_wrap_init(const char* host_type_uri, const char* ui_type_uri, const LV2_Feature* const* features) { - // TODO: What Gtk initialisation is required here? + gtk_init(0, NULL); return 0; } @@ -41,16 +41,15 @@ suil_wrap(const char* host_type_uri, const char* ui_type_uri, SuilInstance* instance) { - GtkWidget* const plug = gtk_plug_new(0); - GtkWidget* const widget = (GtkWidget*)instance->ui_widget; + QX11EmbedContainer* const wrapper = new QX11EmbedContainer(); + GtkWidget* const plug = gtk_plug_new(wrapper->winId()); + GtkWidget* const widget = (GtkWidget*)instance->ui_widget; - gtk_container_add(GTK_CONTAINER(plug), widget); + //wrapper->embedClient(gtk_plug_get_id(GTK_PLUG(plug))); + gtk_container_add(GTK_CONTAINER(plug), widget); gtk_widget_show_all(plug); - QX11EmbedContainer* const wrapper = new QX11EmbedContainer(); - wrapper->embedClient(gtk_plug_get_id(GTK_PLUG(plug))); - #ifdef SUIL_OLD_GTK wrapper->resize(widget->allocation.width, widget->allocation.height); #else |