Fix:Core:draw only when ready, call callback at correct time
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 21 Nov 2009 09:46:46 +0000 (09:46 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 21 Nov 2009 09:46:46 +0000 (09:46 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2778 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit.c

index 63f6398..1a64b38 100644 (file)
@@ -1379,13 +1379,13 @@ navit_init(struct navit *this_)
        navit_window_roadbook_new(this_);
        navit_window_items_new(this_);
 #endif
-       callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
-       this_->ready|=1;
 
        messagelist_init(this_->messages);
 
        navit_set_cursors(this_);
 
+       callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
+       this_->ready|=1;
        dbg(2,"ready=%d\n",this_->ready);
        if (this_->ready == 3)
                navit_draw(this_);
@@ -1652,7 +1652,8 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
                        this_->layout_current=attr->u.layout;
                        graphics_font_destroy_all(this_->gra);
                        navit_set_cursors(this_);
-                       navit_draw(this_);
+                       if (this_->ready == 3)
+                               navit_draw(this_);
                        attr_updated=1;
                }
                break;