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

Re: [MiNT] WM_REPOSED implementation



On Thu, 2005-12-08 at 23:29 +0100, Odd Skancke wrote:

>  XaAES sends new X/Y (and keeps W,H as was) when sending WM_MOVED
> (because per definition MOVE means exactly that, and thus W/H should not
> change), and sends new W/H, keeping same X/Y for WM_SIZED. Why? Because
> per definition SIZED means window was resized, not MOVED.

Per definition, its you message number 27 which is sent when someone
drags a window and message number 28 which is sent when the window is
resized.  Both send the new window coordinates to the application.

Per definition, SIZED means 27 only because your header file defines it
that way.  I can use case 27: and case 28: if I want.  I can use #define
WM_EVANGELIZED 27 and call the message WM_EVANGELIZED if I want.

>  To catch the situation where both coordinate pairs (X/Y AND W/H)
> actually CHANGED, WM_REPOSED was invented. Lets not give new meanings to
> ancient stuff, please. The W/H in WM_MOVED are for convenience only, not
> expected to change. X/Y in WM_SIZED are also for convenience only, not
> expect those to change. Its in the goddamned name of the goddamned
> messages!!!!

You are being unreasonably stupid here.  You are making definitions of
your own interpretations and not even following them.  If you resize
with the size widget, it should send a WM_SIZED, but if you move the
window its WM_MOVED, and if you resize with the window border its ...

wait .. is it always WM_REPOS?  Is it WM_REPOS only if the X or Y
change?  Will it send WM_SIZED if X and Y stay the same?

Applications don't care what your compiler header file defines things
as.  It just knows that when message 27 or 28 comes in - the window has
new coordinates.  You should likely check to see if width or height has
changed in both cases and take appropriate action, however, the little
sample "lazy method" works as well.

There is no reason for the AES to send two different messages other than
historically, each widget usually sent its own type of message.  Doing
this would only slow things down and cause the exact problem you want to
remove with WM_REPOSED.

Let's not cause new problems.  Its long been documented that all 4
coordinates are returned as part of the message.   In your owns words,
"Let's not give new meanings to ancient stuff"  Resizing a window with
the upper left corner should send a WM_SIZED, not a MOVED and then a
SIZED, or a REPOSED which only bloats the API even more!