summaryrefslogtreecommitdiffstats
path: root/src/gtk2_in_qt4.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-02 19:33:13 +0000
committerDavid Robillard <d@drobilla.net>2012-07-02 19:33:13 +0000
commitd9c33340c7954c424f98df8b71daa39323134710 (patch)
treebc5b9897f424c9f394e430e6e2f5e11e2e9ae85d /src/gtk2_in_qt4.cpp
parentc607ceb6a66ef20b6a26ecd1349b2563598febe6 (diff)
downloadsuil-d9c33340c7954c424f98df8b71daa39323134710.tar.gz
suil-d9c33340c7954c424f98df8b71daa39323134710.tar.bz2
suil-d9c33340c7954c424f98df8b71daa39323134710.zip
Correctly handle resizing for Gtk2 in Qt4.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4507 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gtk2_in_qt4.cpp')
-rw-r--r--src/gtk2_in_qt4.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gtk2_in_qt4.cpp b/src/gtk2_in_qt4.cpp
index 7629989..dcec12a 100644
--- a/src/gtk2_in_qt4.cpp
+++ b/src/gtk2_in_qt4.cpp
@@ -25,6 +25,24 @@
extern "C" {
+static void
+on_size_request(GtkWidget* widget,
+ GtkRequisition* requisition,
+ gpointer user_data)
+{
+ QX11EmbedContainer* const wrap = (QX11EmbedContainer*)user_data;
+ wrap->setMinimumSize(requisition->width, requisition->height);
+}
+
+static void
+on_size_allocate(GtkWidget* widget,
+ GdkRectangle* allocation,
+ gpointer user_data)
+{
+ QX11EmbedContainer* const wrap = (QX11EmbedContainer*)user_data;
+ wrap->resize(allocation->width, allocation->height);
+}
+
static int
wrapper_wrap(SuilWrapper* wrapper,
SuilInstance* instance)
@@ -44,6 +62,12 @@ wrapper_wrap(SuilWrapper* wrapper,
wrap->resize(alloc.width, alloc.height);
#endif
+ g_signal_connect(
+ G_OBJECT(plug), "size-request", G_CALLBACK(on_size_request), wrap);
+
+ g_signal_connect(
+ G_OBJECT(plug), "size-allocate", G_CALLBACK(on_size_allocate), wrap);
+
instance->host_widget = wrap;
return 0;