If pane_damaged() is called before the event handler is ready, the
on-idle doesn't get registered properly and will never get called.
So check for errors, and leave damage unset so the next pane_damaged()
call can schedule the on-idle event.
Signed-off-by: NeilBrown <neil@brown.name>
if (!p || (p->damaged | type) == p->damaged)
return;
if (p == p->parent && !p->damaged)
- call_comm("event:on-idle", p, &pane_refresh, 1);
+ if (call_comm("event:on-idle", p, &pane_refresh, 1) <= 0)
+ /* Cannot register an event yet, ignore damage */
+ return;
if (type & (type-1)) {
/* multiple bits are set, handle
* them separately