Fix:gui_internal:Avoid popping up the menu when resizing with an active map
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 19 Jun 2008 18:22:51 +0000 (18:22 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 19 Jun 2008 18:22:51 +0000 (18:22 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1148 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/gui/internal/gui_internal.c

index 45ada2a..b6faef4 100644 (file)
@@ -1375,7 +1375,7 @@ static void gui_internal_button(void *data, int pressed, int button, struct poin
        struct graphics *gra=this->gra;
        
        // if still on the map (not in the menu, yet):
-       if (!this->root.children) {     
+       if (!this->root.children) {
                // check whether the position of the mouse changed during press/release OR if it is the scrollwheel 
                if (!navit_handle_button(this->nav, pressed, button, p, NULL) || button >=4) // Maybe there's a better way to do this
                        return;
@@ -1425,8 +1425,10 @@ static void gui_internal_resize(void *data, int w, int h)
        this->root.h=h;
        dbg(0,"w=%d h=%d\n", w, h);
        navit_resize(this->nav, w, h);
-       gui_internal_prune_menu(this, NULL);
-       gui_internal_menu_root(this);
+       if (this->root.children) {
+               gui_internal_prune_menu(this, NULL);
+               gui_internal_menu_root(this);
+       }
 } 
 
 //##############################################################################################################