The Trunk: Kernel-mt.989.mcz

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

The Trunk: Kernel-mt.989.mcz

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

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

Name: Kernel-mt.989
Author: mt
Time: 16 February 2016, 10:28:16.317748 am
UUID: c658e246-d184-42ce-83dd-7d6f40184726
Ancestors: Kernel-mt.988

Condense ways of peeking the mouse cursor position. Avoid flushing other mouse events when peeking the mouse position. Useful for the profiler.

Note that it is still discouraged to peek the mouse position in Morphic code. We might want to upate all senders of #cursorPoint and #peekPosition.

=============== Diff against Kernel-mt.988 ===============

Item was changed:
  ----- Method: EventSensor>>cursorPoint (in category 'cursor') -----
  cursorPoint
  "Answer a Point indicating the cursor location."
 
+ ^ self peekPosition!
- ^self mousePoint!

Item was removed:
- ----- Method: EventSensor>>mousePoint (in category 'mouse') -----
- mousePoint
- "Answer a Point indicating the coordinates of the current mouse location."
-
- ^self primMousePt!

Item was changed:
  ----- Method: EventSensor>>peekPosition (in category 'accessing') -----
  peekPosition
+ ^ self primMousePt!
- self fetchMoreEvents.
- ^mousePosition!

Item was changed:
  ----- Method: EventSensor>>primMousePt (in category 'private') -----
  primMousePt
  self fetchMoreEvents.
+ "self flushNonKbdEvents. -- mt: Should not be necessary here."
- self flushNonKbdEvents.
  ^ mousePosition!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-mt.989.mcz

Bert Freudenberg

> On 16.02.2016, at 09:28, [hidden email] wrote:
>
> Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-mt.989.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-mt.989
> Author: mt
> Time: 16 February 2016, 10:28:16.317748 am
> UUID: c658e246-d184-42ce-83dd-7d6f40184726
> Ancestors: Kernel-mt.988
>
> Condense ways of peeking the mouse cursor position. Avoid flushing other mouse events when peeking the mouse position. Useful for the profiler.
Why would flushing the events *not* be wanted? When something uses Sensor directly then the mouse events buffered so far are useless and *should* be flushed.

> Note that it is still discouraged to peek the mouse position in Morphic code. We might want to upate all senders of #cursorPoint and #peekPosition.

Exactly.

>  ----- Method: EventSensor>>primMousePt (in category 'private') -----
>  primMousePt
>   self fetchMoreEvents.
> + "self flushNonKbdEvents. -- mt: Should not be necessary here."
> - self flushNonKbdEvents.
>   ^ mousePosition!

I think the flush is necessary, and not harmful, so should be left in. Possibly with a comment.

- Bert -






smime.p7s (5K) Download Attachment