Fix:gui_internal:Call gui_internal_setup_gc early enough
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 24 Oct 2009 20:27:19 +0000 (20:27 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 24 Oct 2009 20:27:19 +0000 (20:27 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2686 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/gui/internal/gui_internal.c
navit/navit.c
navit/navit.h

index 4a6cbfd..6236d27 100644 (file)
@@ -3949,6 +3949,9 @@ static int gui_internal_set_graphics(struct gui_priv *this, struct graphics *gra
        // set fullscreen if needed
        if (this->fullscreen)
                this->win->fullscreen(this->win, this->fullscreen != 0);
+       /* Was resize callback already issued? */
+       if (navit_get_ready(this->nav) & 2)
+               gui_internal_setup_gc(this);
        return 0;
 }
 
index c084961..d5eaaf1 100644 (file)
@@ -205,6 +205,13 @@ navit_draw(struct navit *this_)
        navit_draw_async(this_, 0);
 }
 
+int
+navit_get_ready(struct navit *this_)
+{
+       return this_->ready;
+}
+
+
 
 void
 navit_draw_displaylist(struct navit *this_)
@@ -1100,7 +1107,7 @@ navit_say(struct navit *this_, char *text)
  * @brief Toggles the navigation announcer for navit
  * @param this_ The navit object
  */
-void
+static void
 navit_cmd_announcer_toggle(struct navit *this_)
 {
     struct attr attr, speechattr;
index 665f4e4..5f71c62 100644 (file)
 extern "C" {
 #endif
 extern struct gui *main_loop_gui;
+// defined in glib.h.
+#ifndef __G_LIST_H__
+struct _GList;
+typedef struct _GList GList;
+#endif
+
 /* prototypes */
 enum attr_type;
 struct attr;
@@ -42,17 +48,11 @@ struct route;
 struct tracking;
 struct transformation;
 struct vehicleprofile;
-
-// defined in glib.h.
-#ifndef __G_LIST_H__
-struct _GList;
-typedef struct _GList GList;
-#endif
-
 void navit_add_mapset(struct navit *this_, struct mapset *ms);
 struct mapset *navit_get_mapset(struct navit *this_);
 struct tracking *navit_get_tracking(struct navit *this_);
 void navit_draw(struct navit *this_);
+int navit_get_ready(struct navit *this_);
 void navit_draw_displaylist(struct navit *this_);
 void navit_handle_resize(struct navit *this_, int w, int h);
 int navit_get_width(struct navit *this_);
@@ -68,17 +68,13 @@ void navit_add_message(struct navit *this_, char *message);
 struct message *navit_get_messages(struct navit *this_);
 struct graphics *navit_get_graphics(struct navit *this_);
 struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
-
-//! Returns a list of 'struct vehicleprofile *'
 GList *navit_get_vehicleprofiles(struct navit *this_);
-
 void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
 int navit_check_route(struct navit *this_);
 void navit_add_bookmark(struct navit *this_, struct pcoord *c, const char *description);
 void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
 int navit_speech_estimate(struct navit *this_, char *str);
 void navit_say(struct navit *this_, char *text);
-void navit_announcer_toggle(struct navit *this_);
 void navit_speak(struct navit *this_);
 void navit_window_roadbook_destroy(struct navit *this_);
 void navit_window_roadbook_new(struct navit *this_);