summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2014-06-14 21:57:04 +0200
committerPeter Hofmann <scm@uninformativ.de>2014-06-14 21:57:04 +0200
commitc32e64b89186c09c5d2c9f82a18e0a541dd414b4 (patch)
treedf2d359da80b67be492c07888a81243ced06b242
parentbc890973b214053820afc8e6be0d09d8441c9864 (diff)
downloadlariza-c32e64b89186c09c5d2c9f82a18e0a541dd414b4.tar.gz
Deal with race conditions while embedding
I have not encountered any race conditions. In theory, they could happen, though.
-rw-r--r--zea.c9
1 files changed, 9 insertions, 0 deletions
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