summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-11-28 15:27:04 -0500
committerDavid Robillard <d@drobilla.net>2015-11-28 15:35:34 -0500
commit4c4fb2570f43371666746dde1eb4b6d97608b264 (patch)
tree0bf5b74b6a283261bb585a4153cca5ec371d024c /src
parentf26478e12c443bf693198bfe63dae77c3879c354 (diff)
downloadsuil-4c4fb2570f43371666746dde1eb4b6d97608b264.tar.gz
suil-4c4fb2570f43371666746dde1eb4b6d97608b264.tar.bz2
suil-4c4fb2570f43371666746dde1eb4b6d97608b264.zip
Fix initial size of resizable X11 UIs in Gtk
Diffstat (limited to 'src')
-rw-r--r--src/x11_in_gtk2.c12
1 files changed, 12 insertions, 0 deletions
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);
}
}