Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#7446) center_on_something fails
Home

[Freeciv-Dev] Re: (PR#7446) center_on_something fails

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7446) center_on_something fails
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2004 16:29:28 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >

Raimar Falke wrote:

> init_mapcanvas_and_overview should stay. Please research what is the
> real cause of this problem. No band-aids.

Um, init_mapcanvas_and_overview is the cause of the problem.

Before your patch that created init_mapcanvas_and_overview, the gtk2 
client had code like:

   gtk_widget_show(toplevel);
   overview.store = NULL;

now it is

   gtk_widget_show(toplevel);
   init_mapcanvas_and_overview();

in other words, the mapview was never "initted" before.  Now, however, 
it is configured when the toplevel window is shown (line 1) and later 
"initted" (e.g. overwritten) in line 2.

What it comes down to is that the canvas needs to be configured before 
it is used.  This configuring comes when the GUI calls 
map_canvas_resized.  There is no need to do a pre-configuring for these 
values.  The ones we're setting to zero are already zero (except for the 
bug), and the mapcanvas that gets a dummy value shouldn't ever have this 
value used (that would also be a bug).

A workaround would be to simply remove the init_mapcanvas_and_overview 
call from gui-gtk-2.0.  This would fix the bug in that client while 
leaving the (useless) functionality in the other clients.  Or you could 
call init_mapcanvas_and_overview the first time map_canvas_resized is 
called - except then it would be abundantly clear that the function 
isn't needed.

In short: can you give a reason why this function is needed???

jason




[Prev in Thread] Current Thread [Next in Thread]