static void gui_internal_resize(void *data, int w, int h)
{
struct gui_priv *this=data;
+ int changed=0;
gui_internal_setup_gc(this);
- if( this->root.w==w && this->root.h==h)
- return;
- this->root.w=w;
- this->root.h=h;
+ if (this->root.w != w || this->root.h != h) {
+ this->root.w=w;
+ this->root.h=h;
+ changed=1;
+ }
dbg(1,"w=%d h=%d children=%p\n", w, h, this->root.children);
navit_handle_resize(this->nav, w, h);
- if (this->root.children) {
+ if (this->root.children && changed) {
gui_internal_prune_menu(this, NULL);
gui_internal_menu_root(this);
}
navit_handle_resize(struct navit *this_, int w, int h)
{
struct map_selection sel;
- memset(&sel, 0, sizeof(sel));
- this_->w=w;
- this_->h=h;
- sel.u.p_rect.rl.x=w;
- sel.u.p_rect.rl.y=h;
- transform_set_screen_selection(this_->trans, &sel);
- graphics_init(this_->gra);
this_->ready |= 2;
- graphics_set_rect(this_->gra, &sel.u.p_rect);
+ if (this_->w != w || this_->h != h) {
+ memset(&sel, 0, sizeof(sel));
+ this_->w=w;
+ this_->h=h;
+ sel.u.p_rect.rl.x=w;
+ sel.u.p_rect.rl.y=h;
+ transform_set_screen_selection(this_->trans, &sel);
+ graphics_init(this_->gra);
+ graphics_set_rect(this_->gra, &sel.u.p_rect);
+ }
if (this_->ready == 3)
navit_draw(this_);
}