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

Re: [MiNT] Dialogs in windows

> 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 ...

Actually I am using N.AES 2.0. The problem is that the rectagle I get with 

wind_get_grect( my_window, 
      &r );

is the rectangle that was overlapped but when the window is not topped this
is the rectangle that is overlapped by another application so my application
gets a WM_REDRAW message and overwrites the part of the window of the other
application. Although it looks quite funny it is not what the user expects.

> > 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( my_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 screen.

Thanks for your advice. You are right. I forgot about that. Aniplayer is one
of the candidates who would produce such an effect.

Perhaps someone has some more multitasking friendly code at hand?