The Inbox: Morphic-ct.1625.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-ct.1625.mcz

commits-2
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1625.mcz

==================== Summary ====================

Name: Morphic-ct.1625
Author: ct
Time: 17 February 2020, 5:11:24.527432 pm
UUID: e4c9f15a-c480-d542-9ad3-20490c73e5f1
Ancestors: Morphic-mt.1623

Fixes broken balloon helps on halo handles

Please review.

=============== Diff against Morphic-mt.1623 ===============

Item was changed:
  ----- Method: Morph>>invokeHaloOrMove: (in category 'meta-actions') -----
  invokeHaloOrMove: anEvent
  "Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph."
  | h tfm doNotDrag |
  h := anEvent hand halo.
  "Prevent wrap around halo transfers originating from throwing the event back in"
  doNotDrag := false.
  h ifNotNil:[
  (h innerTarget == self) ifTrue:[doNotDrag := true].
  (h innerTarget hasOwner: self) ifTrue:[doNotDrag := true].
  (self hasOwner: h target) ifTrue:[doNotDrag := true]].
 
  tfm := (self transformedFrom: nil) inverseTransformation.
 
  "cmd-drag on flexed morphs works better this way"
  h := self addHalo: (anEvent transformedBy: tfm).
  h ifNil: [^ self].
  doNotDrag ifTrue:[^self].
  "Initiate drag transition if requested"
  anEvent hand
  waitForClicksOrDrag: h
  event: (anEvent transformedBy: tfm)
  selectors: { nil. nil. nil. #startDragTarget:. }
  threshold: HandMorph dragThreshold.
  "Pass focus explicitly here"
+ anEvent hand mouseFocus: h owner.
- anEvent hand newMouseFocus: h.
  "Reset temporary cursors to make available halo interaction visible."
  anEvent hand showTemporaryCursor: nil.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1625.mcz

marcel.taeumel
Hi Christoph.

Addressed in Morphic-mt.1625. 

Note that "h owner" is dangerous because that can be anything you are not in control in this piece of code. Also, the focus holder was correct for this scenario. That's why I suspected the bug to be somewhere else and started debugging. Took me about 3 hours. -.-" It was related to mouse-over dispatching, which affects mouse-enter and mouse-leave events, which trigger the halo.

Best,
Marcel

Am 17.02.2020 17:11:38 schrieb [hidden email] <[hidden email]>:

Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1625.mcz

==================== Summary ====================

Name: Morphic-ct.1625
Author: ct
Time: 17 February 2020, 5:11:24.527432 pm
UUID: e4c9f15a-c480-d542-9ad3-20490c73e5f1
Ancestors: Morphic-mt.1623

Fixes broken balloon helps on halo handles

Please review.

=============== Diff against Morphic-mt.1623 ===============

Item was changed:
----- Method: Morph>>invokeHaloOrMove: (in category 'meta-actions') -----
invokeHaloOrMove: anEvent
"Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph."
| h tfm doNotDrag |
h := anEvent hand halo.
"Prevent wrap around halo transfers originating from throwing the event back in"
doNotDrag := false.
h ifNotNil:[
(h innerTarget == self) ifTrue:[doNotDrag := true].
(h innerTarget hasOwner: self) ifTrue:[doNotDrag := true].
(self hasOwner: h target) ifTrue:[doNotDrag := true]].

tfm := (self transformedFrom: nil) inverseTransformation.

"cmd-drag on flexed morphs works better this way"
h := self addHalo: (anEvent transformedBy: tfm).
h ifNil: [^ self].
doNotDrag ifTrue:[^self].
"Initiate drag transition if requested"
anEvent hand
waitForClicksOrDrag: h
event: (anEvent transformedBy: tfm)
selectors: { nil. nil. nil. #startDragTarget:. }
threshold: HandMorph dragThreshold.
"Pass focus explicitly here"
+ anEvent hand mouseFocus: h owner.
- anEvent hand newMouseFocus: h.
"Reset temporary cursors to make available halo interaction visible."
anEvent hand showTemporaryCursor: nil.!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1625.mcz

marcel.taeumel
And you chose #mouseFocus:, which is not the public interface to use. Take a look at senders of #mouseFocus: vs. #newMouseFocus: :-)

Am 18.02.2020 14:52:04 schrieb Marcel Taeumel <[hidden email]>:

Hi Christoph.

Addressed in Morphic-mt.1625. 

Note that "h owner" is dangerous because that can be anything you are not in control in this piece of code. Also, the focus holder was correct for this scenario. That's why I suspected the bug to be somewhere else and started debugging. Took me about 3 hours. -.-" It was related to mouse-over dispatching, which affects mouse-enter and mouse-leave events, which trigger the halo.

Best,
Marcel

Am 17.02.2020 17:11:38 schrieb [hidden email] <[hidden email]>:

Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1625.mcz

==================== Summary ====================

Name: Morphic-ct.1625
Author: ct
Time: 17 February 2020, 5:11:24.527432 pm
UUID: e4c9f15a-c480-d542-9ad3-20490c73e5f1
Ancestors: Morphic-mt.1623

Fixes broken balloon helps on halo handles

Please review.

=============== Diff against Morphic-mt.1623 ===============

Item was changed:
----- Method: Morph>>invokeHaloOrMove: (in category 'meta-actions') -----
invokeHaloOrMove: anEvent
"Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph."
| h tfm doNotDrag |
h := anEvent hand halo.
"Prevent wrap around halo transfers originating from throwing the event back in"
doNotDrag := false.
h ifNotNil:[
(h innerTarget == self) ifTrue:[doNotDrag := true].
(h innerTarget hasOwner: self) ifTrue:[doNotDrag := true].
(self hasOwner: h target) ifTrue:[doNotDrag := true]].

tfm := (self transformedFrom: nil) inverseTransformation.

"cmd-drag on flexed morphs works better this way"
h := self addHalo: (anEvent transformedBy: tfm).
h ifNil: [^ self].
doNotDrag ifTrue:[^self].
"Initiate drag transition if requested"
anEvent hand
waitForClicksOrDrag: h
event: (anEvent transformedBy: tfm)
selectors: { nil. nil. nil. #startDragTarget:. }
threshold: HandMorph dragThreshold.
"Pass focus explicitly here"
+ anEvent hand mouseFocus: h owner.
- anEvent hand newMouseFocus: h.
"Reset temporary cursors to make available halo interaction visible."
anEvent hand showTemporaryCursor: nil.!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1625.mcz

Christoph Thiede

Hi Marcel,


great work! Thanks for the fix and the feedback.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 18. Februar 2020 14:53:57
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1625.mcz
 
And you chose #mouseFocus:, which is not the public interface to use. Take a look at senders of #mouseFocus: vs. #newMouseFocus: :-)

Am 18.02.2020 14:52:04 schrieb Marcel Taeumel <[hidden email]>:

Hi Christoph.

Addressed in Morphic-mt.1625. 

Note that "h owner" is dangerous because that can be anything you are not in control in this piece of code. Also, the focus holder was correct for this scenario. That's why I suspected the bug to be somewhere else and started debugging. Took me about 3 hours. -.-" It was related to mouse-over dispatching, which affects mouse-enter and mouse-leave events, which trigger the halo.

Best,
Marcel

Am 17.02.2020 17:11:38 schrieb [hidden email] <[hidden email]>:

Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1625.mcz

==================== Summary ====================

Name: Morphic-ct.1625
Author: ct
Time: 17 February 2020, 5:11:24.527432 pm
UUID: e4c9f15a-c480-d542-9ad3-20490c73e5f1
Ancestors: Morphic-mt.1623

Fixes broken balloon helps on halo handles

Please review.

=============== Diff against Morphic-mt.1623 ===============

Item was changed:
----- Method: Morph>>invokeHaloOrMove: (in category 'meta-actions') -----
invokeHaloOrMove: anEvent
"Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph."
| h tfm doNotDrag |
h := anEvent hand halo.
"Prevent wrap around halo transfers originating from throwing the event back in"
doNotDrag := false.
h ifNotNil:[
(h innerTarget == self) ifTrue:[doNotDrag := true].
(h innerTarget hasOwner: self) ifTrue:[doNotDrag := true].
(self hasOwner: h target) ifTrue:[doNotDrag := true]].

tfm := (self transformedFrom: nil) inverseTransformation.

"cmd-drag on flexed morphs works better this way"
h := self addHalo: (anEvent transformedBy: tfm).
h ifNil: [^ self].
doNotDrag ifTrue:[^self].
"Initiate drag transition if requested"
anEvent hand
waitForClicksOrDrag: h
event: (anEvent transformedBy: tfm)
selectors: { nil. nil. nil. #startDragTarget:. }
threshold: HandMorph dragThreshold.
"Pass focus explicitly here"
+ anEvent hand mouseFocus: h owner.
- anEvent hand newMouseFocus: h.
"Reset temporary cursors to make available halo interaction visible."
anEvent hand showTemporaryCursor: nil.!




Carpe Squeak!