[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Dialogs in windows

> Imagine my window lying in the middle of the screen and another
> window is lying above it in the lower right corner of the window of
> my application.
> So my window is divided into three parts. The upper half of the
> window is free. The lower half is divided into two parts. The left
> hand side is free while the right hand side is hidden by another
> applications window.
> Then I move my application to the left of the desktop (not up). But
> instead of getting just the lower left part of my window so I can
> redraw it, I get both "free" parts of my own window.

As far as I understand the problem and as far as I can remember, this is up
to the AES, what rectangles are to be redrawn. If the window is bottomed and
partially overlapped by another window, I am afraid then, that the AES would
decide that all rectangles are to be redrawn. This at least looks so on
N.AES 2.0. So there is nothing bad in the fact that the AES tells your
application to redraw the parts which are already drawn. Of course, this
perhaps could act more intelligent way, but ...

> This is the code I wrote:
> static void redraw_mywindow( short my_window, short x, short y, short
> w, short h )
> {
>   GRECT r;
>   short w1, w2, w3, w4;
>   /* is window topped?
>   /* then redraw rectangle
>   wind_get( my_window, WF_TOP, &w1, &w2, &w3, &w4 );
>   if( window == w1 )
>   {
>     wind_update( BEG_UPDATE );

If I can have any (irrelevant to the problem you described) comment here:
you should not divide the redrawing routine into two cases, this should be
the same regardless of whether your window is topped or not. At least, in a
multitasking system, after your wind_get(WF_TOP) and before the 'if'
statement, preemption can occur, another application can do something else,
and as a result your window can be no longer on top, right? So when the
scheduler gives the next turn to your application, the result you check with
the 'if (window == w1)' can be no longer valid and you get mess on the scree


Konrad M.Kokoszkiewicz

** Ea natura multitudinis est,
** aut seruit humiliter, aut superbe dominatur (Liv. XXIV,25)
** Taka to juz natura pospólstwa, albo sluzalczo sie plaszczy,
** albo bezczelnie sie panoszy.