World menu delay -- Re: 2.9 speed

Bob Arning arning at
Mon Dec 18 21:15:51 UTC 2000

Hi all,

If the delay in getting a world menu is troubling, try the enclosed change set. The change is that if the were no halos, then the menu pops up right away. If people like this, I will lobby for inclusion.


On Mon, 18 Dec 2000 16:02:04 -0500 Doug Way <dway at> wrote:
>But I have a feeling that what you're seeing are some 200ms delays which were added to some operations in Morphic.  For example, bringing up the World menu now requires that you hold down the button for at least 200ms before it pops up.  I think this was done as a simple implementation so that a "quick click" on the desktop would shake off halos.  I also notice that this delay is now in PluggableListMorphs too, so that selecting a list item always takes at least 200ms in a Browser, for example.  (I'm not sure why this was added here.)
>For what it's worth, I think that these 200ms delays are a VERY BAD idea from a "feel" perspective.  It gives the impression that Morphic is slow when it really isn't.  (The only case of a delayed pop-up menu in a UI that I can think of is with something like Netscape on the Mac, where if you hold down a mouse on a link, a pop-up menu eventually appears, as opposed to a quick click which simply follows the link.  But that delay is much more justifiable than the ones in Squeak, IMHO.)
>I think it should be possible (although slightly more complicated) to implement things so that a 200ms delay in opening the World menu isn't necessary, but halos are still shaken off.  I actually implemented a changeset which did most of this a few months ago, but it was made obsolete by the significant changes to Morphic in the last couple months.  Maybe I'll take another stab at it, unless someone else wants to try.

=====code follows=====
'From Squeak2.9alpha of 17 July 2000 [latest update: #3187] on 18 December 2000 at 4:12:44 pm'!

!PasteUpMorph methodsFor: 'event handling' stamp: 'RAA 12/18/2000 16:12'!
mouseDown: evt
	"Handle a mouse down event."
	| grabbedMorph handHadHalos |
	grabbedMorph _ self morphToGrab: evt.
	grabbedMorph ifNotNil:[
		grabbedMorph isSticky ifTrue:[^self].
		self isPartsBin ifFalse:[^evt hand grabMorph: grabbedMorph].
		grabbedMorph _ grabbedMorph partRepresented duplicate.
		grabbedMorph restoreSuspendedEventHandler.
		(grabbedMorph fullBounds containsPoint: evt position) 
			ifFalse:[grabbedMorph position: evt position].
		"Note: grabbedMorph is ownerless after duplicate so use #grabMorph:from: instead"
		^evt hand grabMorph: grabbedMorph from: self].

	(super handlesMouseDown: evt)
		ifTrue:[^super mouseDown: evt].
	handHadHalos _ evt hand halo notNil.
	evt hand halo: nil. "shake off halos"
	evt hand releaseKeyboardFocus. "shake of keyboard foci"
	evt shiftPressed ifTrue:[
		^evt hand 
			waitForClicksOrDrag: self 
			event: evt 
			selectors: { #findWindow:. nil. #dragThroughOnDesktop:}
			threshold: 5].
	self isWorldMorph ifTrue: [
		handHadHalos ifTrue: [^self addAlarm: #invokeWorldMenu: with: evt after: 200].
		^self invokeWorldMenu: evt
	"otherwise, explicitly ignore the event if we're not the world,
	so that we could be picked up if need be"
	self isWorldMorph ifFalse:[evt wasHandled: false].
! !

More information about the Squeak-dev mailing list