The Trunk: Morphic-mt.1148.mcz

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

The Trunk: Morphic-mt.1148.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1148.mcz

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

Name: Morphic-mt.1148
Author: mt
Time: 18 May 2016, 9:09:28.46726 am
UUID: 07784181-3cb6-0b41-b79a-f1af6919a9a1
Ancestors: Morphic-mt.1147

Next attempt to improve the support for not discarding existing selections when the text morph needs a mouse click to get keyboard focus.

See: http://forum.world.st/text-selection-broken-td4895226.html

=============== Diff against Morphic-mt.1147 ===============

Item was changed:
  ----- Method: TextMorph>>mouseDown: (in category 'event handling') -----
  mouseDown: evt
  "Make this TextMorph be the keyboard input focus, if it isn't  
  already, and repond to the text selection gesture."
 
  evt yellowButtonPressed ifTrue: [
  "First check for option (menu) click"
  ^ self yellowButtonActivity: evt shiftPressed].
 
+ "If focus does not follow the mouse cursor and we click below everything, just grab the focus to not destroy the selection."
+ ((self hasKeyboardFocus: evt hand) not and: [(self bounds containsPoint: evt position) not])
+ ifTrue: [evt hand newKeyboardFocus: self]
+ ifFalse: [
+ evt hand newKeyboardFocus: self.
+ self
+ handleInteraction: [editor mouseDown: evt]
+ fromEvent: evt].!
- evt hand newKeyboardFocus: self.
-
- (self bounds containsPoint: evt position) ifTrue: [
- self
- handleInteraction: [editor mouseDown: evt]
- fromEvent: evt].!