# HG changeset patch # User ca # Date 1037604294 -3600 # Node ID 954415c8fa83a69cedf40eade9ceaae66ddcff5d # Parent b6ddb8e6e3eb938f55fd8cdd1c13122eb05efaac bug fix in #pointerLeave: the KDE sends a #pointerLeave: with each button press which should be discard diff -r b6ddb8e6e3eb -r 954415c8fa83 VariablePanelController.st --- a/VariablePanelController.st Fri Nov 15 14:44:31 2002 +0100 +++ b/VariablePanelController.st Mon Nov 18 08:24:54 2002 +0100 @@ -260,18 +260,32 @@ ! pointerEnter:state x:bx y:by - |h| + "this could be send by the KDE before a button press event; + test whether the state == 0 + " + |handle| + + state ~~ 0 ifTrue:[ ^ self ]. - state == 0 ifTrue:[ - view snapMode notNil ifTrue:[ - (h := self detectHandleIndexAt:bx y:by) notNil ifTrue:[ - self buttonMotion:state x:bx y:by - ] - ] - ] + view snapMode notNil ifTrue:[ + "/ test whether a handle is under the cursor + handle := self detectHandleIndexAt:bx y:by. + + handle notNil ifTrue:[ + "/ there is a handel; thus we have to setup the cursor... + self buttonMotion:state x:bx y:by + ]. + ]. ! pointerLeave:state + "this could be send by the KDE before a button press event; + test whether the state == 0 + " + state ~~ 0 ifTrue:[ ^ self ]. + + "/ the view is leave and no button is pressed + "/ restore the cursor and redraw the snap if not nil saveCursor notNil ifTrue:[ "restore the cursor" @@ -279,14 +293,12 @@ saveCursor := nil ]. - state == 0 ifTrue:[ - resizeMode := nil. + resizeMode := nil. - movedHandle notNil ifTrue:[ - view drawSnapAt:movedHandle. - self buttonRelease:1 x:0 y:0. - movedHandle := nil. - ] + movedHandle notNil ifTrue:[ + view drawSnapAt:movedHandle. + self buttonRelease:1 x:0 y:0. + movedHandle := nil. ]. ! ! @@ -545,7 +557,7 @@ !VariablePanelController class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.39 2002-10-30 13:46:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.40 2002-11-18 07:24:54 ca Exp $' ! !