Investigating fullBounds/layoutChanged

Andreas Raab Andreas.Raab at gmx.de
Thu Oct 17 22:56:50 UTC 2002


> Am I getting at anything here?

Nope, sorry, you're not.

First of all, if you put your beep into Morph I'm surprised that you
aren't getting crazy with all the beeping around (you must be running
this on Windows - it's a known effect that sending a hundred million
beeps may only result in a single one actually being played; #beep is
asynchronous on Windows).

Secondly, think about it - the hand (aka "the user representation", "the
mouse impersonation") is a morph too, yes?! So the hand is a morph, and
if a morph moves it has to notify its parent about that change which in
turn will invalidate its layout. So that, whenever you move your cursor,
the hand will notify its parent (the world) which will in fact send a
layoutChanged. If no layoutChanged would be sent if the hand moves then
something would be horribly broken.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Eddie Cottongim
> Sent: Friday, October 18, 2002 12:20 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Investigating fullBounds/layoutChanged
> 
> 
> While playing around with fullBounds and layoutChanged, I 
> noticed that both
> are invoked once for every mouse move.
> 
> (I checked this by placing a Smalltalk beep in 
> Morph>>fullBounds and later
> in Morph>>layoutChanged - don't use the Transcript for 
> tracing those, as
> there will be an infinite loop.)
> 
> I can understand why fullBounds might be required for every mouse move
> (deciding what morph an event goes to), but unfortunately, 
> every time, it is
> taking the 'long route' of doing the layout, merging submorph 
> bounds, etc
> instead of using the cached value in the instance var 
> fullBounds. (this is
> verified by putting the beep after the check for fullBounds
> ifNotNil:[^fullBounds] - it still beeps once for each mouse move.)
> 
> It seems the instance variable fullBounds is always nil at 
> these times.
> layoutChanged being sent once/mouse move would explain this, 
> since it sets
> fullBounds to nil. I haven't figured out exactly who is sending the
> layoutChanged and why. (That selector has a lot of senders..) 
> Someone else
> might know this.
> 
> Am I getting at anything here? It seems layoutChanged 
> shouldn't be sent at
> all for mouse movements. If that could resolved it would 
> avoid a lot of the
> fullBounds work. Its not a big speed hit for fast machines, 
> but it still
> might be worth cleaning up.
> 
> Thanks,
> Eddie
> 
> 
> 
> 
> 




More information about the Squeak-dev mailing list