'From Squeak3.6 of ''6 October 2003'' [latest update: #5424] on 14 June 2004 at 4:31:07 pm'! !HandMorph methodsFor: 'focus handling' stamp: 'Tsutomu Hiroshima 4/14/2004 19:36'! newKeyboardFocus: aMorphOrNil "Make the given morph the new keyboard focus, canceling the previous keyboard focus if any. If the argument is nil, the current keyboard focus is cancelled." | oldFocus | oldFocus _ self keyboardFocus. self keyboardFocus: aMorphOrNil. oldFocus ifNotNil: [oldFocus == aMorphOrNil ifFalse: [ oldFocus keyboardFocusChange: false. self compositionWindowManager setCompositionFocus: false]]. aMorphOrNil ifNotNil: [aMorphOrNil keyboardFocusChange: true. self compositionWindowManager keyboardFocusForAMorph: aMorphOrNil]. ! ! !ImmAbstractPlatform methodsFor: 'all' stamp: 'Tsutomu Hiroshima 1/21/2004 07:32'! setCompositionFocus: aBoolean "do nothing" ! ! !ImmX11 methodsFor: 'as yet unclassified' stamp: 'Tsutomu Hiroshima 4/14/2004 19:32'! keyboardFocusForAMorph: aMorph | left bottom pos | "aMorph ifNil: [^ self]." "Sender has already checked this." [ pos _ aMorph prefereredKeyboardPosition. left _ (pos x min: Display width max: 0) asInteger. bottom _ (pos y min: Display height max: 0) asInteger + (aMorph paragraph characterBlockForIndex: aMorph editor selectionInterval first) height. self setCompositionWindowPositionX: left y: bottom. self setCompositionFocus:true. ] on: Error do: [:ex |]. ! ! !ImmX11 methodsFor: 'as yet unclassified' stamp: 'Tsutomu Hiroshima 1/21/2004 07:31'! setCompositionFocus: aBoolean ^ nil ! ! !SystemWindow methodsFor: 'event handling' stamp: 'Tsutomu Hiroshima 4/14/2004 19:47'! mouseDown: evt self setProperty: #clickPoint toValue: evt cursorPoint. TopWindow == self ifFalse: [evt hand releaseKeyboardFocus. self activate] ifTrue: [evt hand compositionWindowManager setCompositionFocus: false]. model windowActiveOnFirstClick ifTrue: ["Normally window keeps control of first click. Need explicit transmission for first-click activity." submorphs do: [:m | (m containsPoint: evt cursorPoint) ifTrue: [m mouseDown: evt]]] ! !