diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/gtk2_in_qt4.cpp | 24 | ||||
-rw-r--r-- | wscript | 2 |
3 files changed, 26 insertions, 1 deletions
@@ -1,6 +1,7 @@ suil (9999) unstable; * Fix typo in suil_ui_supported() documentation + * Correctly handle resizing for Gtk2 in Qt4 -- David Robillard <d@drobilla.net> 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; @@ -7,7 +7,7 @@ from waflib.extras import autowaf as autowaf import waflib.Logs as Logs, waflib.Options as Options # Version of this package (even if built as a child) -SUIL_VERSION = '0.6.2' +SUIL_VERSION = '0.6.3' SUIL_MAJOR_VERSION = '0' # Library version (UNIX style major, minor, micro) |