[Freeciv-Dev] Re: (PR#7446) center_on_something fails
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >
On Mon, 12 Apr 2004, Raimar Falke wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >
>
> On Mon, Apr 12, 2004 at 04:29:28PM -0700, Jason Short wrote:
> >
> > <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.
>
> So it should work if we switch the lines?
>
> > 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).
>
> These two
> mapview_canvas.store = canvas_create(1, 1);
> mapview_canvas.single_tile
> = canvas_create(UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT);
> aren't set to zero. Are these the bugs you speak about?
>
> At least the single_tile assignment isn't IMHO.
>
> While I agree that the assignment of zeros is not needed it is better
> to make this explicit IMHO.
Do not allocate or resize the backing store of the map canvas outside
the map_canvas_resized callback function. Period.
That is the correct way of doing it. GTK+ 2.2 will execute the callback
every time the map is resized and yes, even on creation.
Xaw and GTK+ 1.2 are broken, they mix the resize handling with the expose
handling, this makes no sense and is stupid. There was no reason to break
GTK+ 2.2 as well just to use common code. Please put it right like it was.
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
- [Freeciv-Dev] (PR#8481) Map not properly centered upon game start, Per I. Mathisen, 2004/04/10
- [Freeciv-Dev] (PR#7446) Re: (PR#8481) Map not properly centered upon game start, Jason Short, 2004/04/10
- [Freeciv-Dev] (PR#7446) center_on_something fails, Jason Short, 2004/04/12
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/12
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/12
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/12
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/12
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails,
Vasco Alexandre da Silva Costa <=
- [Freeciv-Dev] (PR#7446) center_on_something fails, Vasco Alexandre da Silva Costa, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Raimar Falke, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Vasco Alexandre da Silva Costa, 2004/04/13
- [Freeciv-Dev] Re: (PR#7446) center_on_something fails, Jason Short, 2004/04/13
|
|