diff options
author | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-04-11 17:40:15 +0200 |
---|---|---|
committer | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-04-11 17:40:15 +0200 |
commit | fe6747705e3cc7c52e4c27ba47efad865452c68d (patch) | |
tree | 6e9a2b6bb9d8b11f352b05a2a099a30261868afd | |
parent | 8e2a10cf5f948676685ffc7377ea89d5f928330a (diff) | |
download | weston-common-fe6747705e3cc7c52e4c27ba47efad865452c68d.tar.gz weston-common-fe6747705e3cc7c52e4c27ba47efad865452c68d.tar.bz2 weston-common-fe6747705e3cc7c52e4c27ba47efad865452c68d.zip |
tz-launcher: fix color, retry connecting multiple times.
Change-Id: Ic01487d3c77e3a3409c331ec90b2c0c0aa55a75c
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r-- | tz-launcher/tz-launcher-wl.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tz-launcher/tz-launcher-wl.c b/tz-launcher/tz-launcher-wl.c index 5d934b6..70b83f5 100644 --- a/tz-launcher/tz-launcher-wl.c +++ b/tz-launcher/tz-launcher-wl.c @@ -324,11 +324,15 @@ redraw_handler(struct widget *widget, void *data) allocation.height); red = green = blue = 0.0; - switch (main_window->user[0] % 3) { + switch (getuid() % 10) { + case 0: red = green = blue = 0.0; break; case 1: red = 1.0; break; - case 2: green = 1.0; break; - case 0: blue = 1.0; break; + case 2: blue = 1.0; break; + case 3: green = 1.0; break; + case 9: red = green = 1.0; break; + default: red = blue = 1.0; break; } + cairo_set_source_rgba (cr, red, green, blue, 0.5); cairo_fill (cr); @@ -401,9 +405,18 @@ main_window_destroy () void tz_launcher_wl_run (int desktopfiles, gchar ***desktoptable) { - struct display *display; - - display = display_create (NULL, NULL); + struct display *display = NULL; + int retries = 0; + + while (!display) { + display = display_create (NULL, NULL); + if (!display) { + retries++; + if (retries > 3) + break; + sleep (3); + } + } if (!display) { g_printerr ("Failed to connect to a Wayland compositor !\n"); int i; |