Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11174) client segfaults w/o map_canvas_resized()
Home

[Freeciv-Dev] Re: (PR#11174) client segfaults w/o map_canvas_resized()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#11174) client segfaults w/o map_canvas_resized()
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Tue, 30 Nov 2004 22:12:56 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Tue, Nov 30, 2004 at 10:50:21AM -0800, Jason Short wrote:
> > Maybe I'm calling init_mapcanvas_and_overview() too late, but this is
> > causing my map to start out as one single tile.  You might want to check
> > the other clients just to be sure.  (Gosh, I hope it's just me.)
> 
> You have to call map_canvas_resized after init_mapcanvas_and_overview to 
> resize your screen.  So the map_canvas_resized() call in 

But don't most clients merely call map_canvas_resized() upon a resize
event?  If you call init_mapcanvas_and_overview() *after* you have
created your widget (as I did), then the initial resize event has
already been sent, and init_mapcanvas_and_overview() will resize the
perfectly good-sized map.

I just looked at the GTK client, and it does the right thing.  It's
probably just me who screwed up, because I had to shift some things
around to make them work.  I just wanted to make sure I didn't cause
some bad shit to happen to any client.  (After all, it used to be a
dummy call, so its location wasn't important until now.)

> avoid a potential crash.  The only way it could really be improved is to 
> give width/height parameters to the init_mapcanvas_and_overview() 
> function, so the caller is forced to pick a size at the beginning.  But 
> I think this is overkill.

The only thing I could suggest would be to not resize the map if it was
already created.


-- 
             Frédéric Brière    <*>    fbriere@xxxxxxxxxxx

 =>  <fbriere@xxxxxxxxxx> IS NO MORE:  <http://www.abacomsucks.com>  <=





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