[FIX] SystemWindow fastFrameDragging misgrabs

Brian Keefer mgomes21 at cox.net
Tue Mar 19 07:58:30 UTC 2002


> 3. A problem that has been bugging me for awhile:  (with fastDragWindowForMorphic turned on) Try opening a dual change sorter window, and as soon as the window appears on the screen, quickly mousedown on the titlebar of the window and drag the window down a few inches, without letting go of the mouse.  After a few seconds the titlebar of the changesorter will lighten (because the window has finished opening), and then you can continue to drag the window (since you didn't let go of the button), but the mouse cursor is a few inches below the title bar of the window that you're dragging!  This problem happens to a lesser extent when I'm just moving windows around normally, but it's most noticeable when opening a new window which takes a while to initialize, such as
> a changesorter.

#3 has annoyed me for a while, too. This changeset makes the dragged
window start relative to where you first clicked, not wherever the mouse
jerked to while the SystemWindow was waiting to see if this drag was
merely a sloppy click.

This changeset works on both 3.2 and 3.3.
-------------- next part --------------
'From Squeak3.2gamma of 15 January 2002 [latest update: #4743] on 19 March 2002 at 2:14:14 am'!

!SystemWindow methodsFor: 'events' stamp: 'bmk 3/19/2002 02:09'!
doFastFrameDrag:grabPoint

	| offset newBounds outerWorldBounds |

	outerWorldBounds _ self boundsIn: nil.
	offset _ outerWorldBounds origin - grabPoint.
	newBounds _ outerWorldBounds newRectFrom: [:f | 
		Sensor cursorPoint + offset extent: outerWorldBounds extent
	].
	^ self position: (self globalPointToLocal: newBounds topLeft); comeToFront! !

!SystemWindow methodsFor: 'events' stamp: 'bmk 3/19/2002 02:11'!
mouseMove: evt
	| cp |
	cp _ evt cursorPoint.
	self valueOfProperty: #clickPoint ifPresentDo: 
		[:firstClick |
		((self labelRect containsPoint: firstClick) and: [(cp dist: firstClick) > 3]) ifTrue:
		["If this is a drag that started in the title bar, then pick me up"
		^ self isSticky ifFalse:
			[self fastFramingOn 
				ifTrue: [self doFastFrameDrag:firstClick]
				ifFalse: [evt hand grabMorph: self topRendererOrSelf]]]].
	model windowActiveOnFirstClick ifTrue:
		["Normally window takes control on first click.
		Need explicit transmission for first-click activity."
		submorphs do: [:m | (m containsPoint: cp) ifTrue: [m mouseMove: evt]]]! !

SystemWindow removeSelector: #doFastFrameDrag!


More information about the Squeak-dev mailing list