primaryHand

Leandro Caniglia caniglia at dm.uba.ar
Tue Dec 22 17:25:17 UTC 1998


The multi-hand support of Squeak gets compromised by improper use of the
#primaryHand message. For example, in some circumstances if the user, using
a hand different from the primary, invokes a pop-up menu, then the menu is
popped-up by the primary hand, not by the user's hand. This happens because
of the ScrollPane|#yellowButtonActivity: method implementation. On the other
way, the method PluggableTextMorph|#scrollBarMenuButtonPressed: correctly
uses the event hand.

The EventRecorderMorph I'm working on is very good for making this problem
quite apparent. For example, when playing back a recorded sequence of
events, the "active" hand is a second hand, not the primary one. Thus, the
playback gets confused when a pop-up menu goes to the primary hand instead
of the playing hand.

Since there are lots of senders of #primaryHand, it is not possible to patch
all of them. But I think the problem gets partially solved looking only for
the senders of primaryHand lastEvent. In 2.2 there are only 5 methods
sending this message. I think that an acceptable change could be to replace
primaryHand with activeHand in at least one of them:
ScrollPane|#yellowButtonActivity:.

ScrollPane|yellowButtonActivity: shiftKeyState
     | menu event |
     (menu _ self getMenu: shiftKeyState) ifNotNil:
        [event _ self activeHand lastEvent.
        menu setInvokingView: self.
        menu popUpAt: event cursorPoint event: event]

World|activeHand
    ^ (self world ifNil: [^ nil]) activeHand





More information about the Squeak-dev mailing list