From c32e64b89186c09c5d2c9f82a18e0a541dd414b4 Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Sat, 14 Jun 2014 21:57:04 +0200 Subject: Deal with race conditions while embedding I have not encountered any race conditions. In theory, they could happen, though. --- zea.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zea.c b/zea.c index 6ffe994..22be5e8 100644 --- a/zea.c +++ b/zea.c @@ -230,6 +230,15 @@ zea_new_client(const gchar *uri) else { c->win = gtk_plug_new(embed); + while (!gtk_plug_get_embedded(GTK_PLUG(c->win))) + { + fprintf(stderr, "zea: Not yet embedded! Waiting a second...\n"); + sleep(1); + + if (c->win != NULL) + gtk_widget_destroy(c->win); + c->win = gtk_plug_new(embed); + } } /* When using Gtk2, zea only shows a white area when run in -- cgit v1.2.3