diff options
author | David Robillard <d@drobilla.net> | 2015-11-28 15:27:04 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-11-28 15:35:34 -0500 |
commit | 4c4fb2570f43371666746dde1eb4b6d97608b264 (patch) | |
tree | 0bf5b74b6a283261bb585a4153cca5ec371d024c | |
parent | f26478e12c443bf693198bfe63dae77c3879c354 (diff) | |
download | suil-4c4fb2570f43371666746dde1eb4b6d97608b264.tar.gz suil-4c4fb2570f43371666746dde1eb4b6d97608b264.tar.bz2 suil-4c4fb2570f43371666746dde1eb4b6d97608b264.zip |
Fix initial size of resizable X11 UIs in Gtk
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/x11_in_gtk2.c | 12 |
2 files changed, 14 insertions, 1 deletions
@@ -4,6 +4,7 @@ suil (0.8.3) unstable; * Add Cocoa in Gtk wrapper (patch from Robin Gareus) * Various Windows fixes (patches from Robin Gareus) * Center X11 UIs in Gtk (patch from Robin Gareus) + * Fix initial size of resizable X11 UIs in Gtk (patch from Robin Gareus) * Add Gtk2 and X11 in Qt5 wrappers (patch from Rui Nuno Capela) * Fix compilation with -Wl,--no-undefined * Fix a few minor/unlikely memory errors @@ -11,7 +12,7 @@ suil (0.8.3) unstable; * Only report suil_ui_supported() if necessary wrapper is compiled in * Upgrade to waf 1.8.14 - -- David Robillard <d@drobilla.net> Sat, 28 Nov 2015 15:22:29 -0500 + -- David Robillard <d@drobilla.net> Sat, 28 Nov 2015 15:26:47 -0500 suil (0.8.2) stable; diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c index e46fe8d..6cd8677 100644 --- a/src/x11_in_gtk2.c +++ b/src/x11_in_gtk2.c @@ -157,6 +157,14 @@ forward_key_event(SuilX11Wrapper* socket, (XEvent*)&xev); } +static gboolean +idle_size_request(gpointer user_data) +{ + GtkWidget* w = GTK_WIDGET(user_data); + gtk_widget_queue_resize(w); + return FALSE; +} + static void forward_size_request(SuilX11Wrapper* socket, GtkAllocation* allocation) @@ -201,6 +209,10 @@ forward_size_request(SuilX11Wrapper* socket, XMoveWindow(GDK_WINDOW_XDISPLAY(window), (Window)socket->instance->ui_widget, wx, wy); + } else { + /* Child has not been realized, so unable to resize now. + Queue an idle resize. */ + g_idle_add(idle_size_request, socket->plug); } } |