#BUGFIX by stefan
class: XWorkstation
removed: #buttonPress:x:y:view:
changed: #buttonPress:button:state:x:y:rootX:rootY:time:
https://expeccoalm.exept.de/D196800
no doubleClick if distance between two clicks is too large
--- a/XWorkstation.st Fri May 05 12:07:33 2017 +0200
+++ b/XWorkstation.st Tue May 09 10:48:00 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -24,9 +26,10 @@
eventRootY displayName eventTrace dispatchingExpose rgbVisual
rgbaVisual virtualRootId rootId altModifierMask metaModifierMask
lastEventTime rawMonitorBounds monitorBounds lastButtonPressTime
- deviceIOTimeoutErrorSignal activateOnClick rawKeySymTranslation
- selectionOwner clipboardSelectionTime primarySelectionTime
- selectionFetchers selectionHandlers preWaitAction xlibTimeout
+ lastButtonPressPosition deviceIOTimeoutErrorSignal
+ activateOnClick rawKeySymTranslation selectionOwner
+ clipboardSelectionTime primarySelectionTime selectionFetchers
+ selectionHandlers preWaitAction xlibTimeout
xlibTimeoutForWindowCreation hasConnectionBroken uniqueDeviceID
stxDeviceAtom uuidAtom primaryBuffer windowGroupWindow
maxOperationsUntilFlush operationsUntilFlush lastError'
@@ -5168,7 +5171,7 @@
buttonPress:view button:button state:state x:x y:y rootX:rX rootY:rY time:time
"forward a buttonPress event for some view"
- |logicalButton|
+ |logicalButton clickPosition|
lastEventTime := time.
altDown := state bitTest:altModifierMask.
@@ -5189,31 +5192,36 @@
].
logicalButton isInteger ifTrue:[
- buttonsPressed := buttonsPressed bitOr:(1 bitShift:logicalButton-1).
- ].
-
- (multiClickTimeDelta notNil and:[lastButtonPressTime notNil]) ifTrue:[
- time < (lastButtonPressTime + multiClickTimeDelta) ifTrue:[
- lastButtonPressTime := time.
- self buttonMultiPress:logicalButton x:x y:y view:view.
- ^ self.
- ].
+ buttonsPressed := buttonsPressed bitOr:(1 bitShift:logicalButton-1).
+ ].
+
+ clickPosition := x @ y.
+
+ (multiClickTimeDelta notNil
+ and:[lastButtonPressTime notNil
+ and:[time < (lastButtonPressTime + multiClickTimeDelta)
+ and:[(clickPosition dist:lastButtonPressPosition) < 6]]]) ifTrue:[
+ lastButtonPressTime := time.
+ lastButtonPressPosition := clickPosition.
+ self buttonMultiPress:logicalButton x:x y:y view:view.
+ ^ self.
].
lastButtonPressTime := time.
+ lastButtonPressPosition := clickPosition.
view isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
- ].
- logicalButton == 1 ifTrue:[
- activateOnClick == true ifTrue:[
- "/ don't raise above an active popup view.
- (activeKeyboardGrab isNil and:[activePointerGrab isNil]) ifTrue:[
- view topView raise.
- ]
- ].
- ].
- super buttonPress:logicalButton x:x y:y view:view
+ "/ event arrived, after I destroyed it myself
+ ^ self
+ ].
+ (logicalButton == 1 and:[activateOnClick == true]) ifTrue:[
+ "/ don't raise above an active popup view.
+ (activeKeyboardGrab isNil and:[activePointerGrab isNil]) ifTrue:[
+ view topView raise.
+ ]
+ ].
+ self buttonPress:logicalButton x:x y:y view:view
+
+ "Modified: / 09-05-2017 / 10:33:01 / stefan"
!
buttonRelease:view button:button state:state x:x y:y rootX:rX rootY:rY time:time
@@ -6651,29 +6659,6 @@
^ super viewIsRelevantInCheckForEndOfDispatch:aView
! !
-!XWorkstation methodsFor:'event handling-old dispatch'!
-
-buttonPress:button x:x y:y view:aView
- "forward a button-press event for some view"
-
- aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
- ].
- button == 1 ifTrue:[
- activateOnClick == true ifTrue:[
- "/ don't raise above an active popup view.
- (activeKeyboardGrab isNil and:[activePointerGrab isNil]) ifTrue:[
- aView topView raise.
-"/ ] ifFalse:[
-"/ activeKeyboardGrab printCR.
-"/ activePointerGrab printCR.
- ]
- ].
- ].
- super buttonPress:button x:x y:y view:aView
-! !
-
!XWorkstation methodsFor:'event sending'!
sendClientEvent:msgType format:msgFormat to:targetWindowID propagate:propagate eventMask:eventMask window:windowID data1:d1 data2:d2 data3:d3 data4:d4 data5:d5
@@ -7932,7 +7917,7 @@
).
Screen current
- heightOf:'hello World gggÖÜ' from:1 to:15
+ heightOf:'hello World gggÖÜ' from:1 to:15
inFont:(Screen current getDefaultFontWithEncoding:#'iso10646-1')
"
!