From 87fafd3767ed058bdd90f21de21cca5c78db0a0a Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 4 Apr 2010 02:04:34 +0200 Subject: [PATCH] fix bug when h-d crashes --- sdlhaa/src/SDL_haa.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sdlhaa/src/SDL_haa.c b/sdlhaa/src/SDL_haa.c index 3259884..ca92ffa 100644 --- a/sdlhaa/src/SDL_haa.c +++ b/sdlhaa/src/SDL_haa.c @@ -335,7 +335,7 @@ static void actor_update_ready(HAA_ActorPriv* actor) int actual_format; unsigned long nitems, bytes_after; unsigned char *prop = NULL; - + status = XGetWindowProperty(display, window, ATOM(_HILDON_ANIMATION_CLIENT_READY), 0, 32, False, XA_ATOM, @@ -353,12 +353,17 @@ static void actor_update_ready(HAA_ActorPriv* actor) } if (actor->ready) { - /* Ready flag already set, which means hildon-desktop just restarted */ + /* Ready flag already set, which means hildon-desktop just restarted. + Reset this actor. */ XUnmapWindow(display, window); XSync(display, False); XMapWindow(display, window); XSync(display, False); - SDL_Delay(500); /* Give the WM some time to relax. */ + + /* Hildon-desktop restarting means all the system will be under + extreme load. Relax. */ + // TODO: Delay once per crash, not per actor. + SDL_Delay(500); /* Next Flip will resend every setting */ actor->p.pending = HAA_PENDING_EVERYTHING; @@ -461,6 +466,7 @@ HAA_Actor* HAA_CreateActor(Uint32 flags, actor->p.z_rotation_y = 0; actor->p.pending = HAA_PENDING_POSITION | HAA_PENDING_SCALE | HAA_PENDING_PARENT; + actor->ready = 0; /* Select the X11 visual */ int screen = DefaultScreen(display); -- 1.7.9.5