<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 16, 2015 at 3:16 PM, Tobias Pape <span dir="ltr">&lt;<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 16.04.2015, at 11:54, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
<br>
&gt; Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>
&gt; <a href="http://source.squeak.org/trunk/Morphic-mt.886.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-mt.886.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: Morphic-mt.886<br>
&gt; Author: mt<br>
&gt; Time: 16 April 2015, 1:54:44.817 pm<br>
&gt; UUID: 18559879-ba01-5e4b-a89a-06fc842be3d7<br>
&gt; Ancestors: Morphic-mt.885<br>
&gt;<br>
&gt; Fixes position of user dialogs if no position is provided. Ensures to use the actual mouse cursor position.<br>
&gt;<br>
&gt; =============== Diff against Morphic-mt.885 ===============<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;  ----- Method: UserDialogBoxMorph&gt;&gt;runModalIn:forHand:at: (in category &#39;running&#39;) -----<br>
&gt;  runModalIn: aWorld forHand: aHand at: aPointOrNil<br>
&gt;       &quot;Ensure that we have a reasonable minimum size&quot;<br>
&gt;       | oldFocus pos offset |<br>
&gt;       (ProvideAnswerNotification signal: self label asString) ifNotNil:[:answer| ^answer].<br>
&gt;       self openInWorld: aWorld.<br>
&gt; +     pos := aPointOrNil ifNil: [<br>
&gt; +             &quot;If called after a longer UI operation, be sure to use the current mouse cursor. Hand position is not up-to-date. Do one world cycle does not help if there are currently no mouse events. So, we *have to be* this extreme.&quot;<br>
&gt; +             Sensor cursorPoint].<br>
<br>
</span>I am not really happy with the direct access to Sensor here.<br>
What about<br>
<br>
        self activeHand position<br>
<br>
<br>
or probably<br>
        self activeHand lastEvent cursorPoint<br>
<br>
? Isn&#39;t this info up-to-date?<br></blockquote><div><br></div><div>The info is not up to date, the mouse position is where the mouse down / up happened that started the update process.</div><div><br></div><div>Karl</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best<br>
<span class="HOEnZb"><font color="#888888">        -Tobias<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
&gt; -     pos := aPointOrNil ifNil: [aHand position].<br>
&gt;       offset := aPointOrNil<br>
&gt;               ifNil: [selectedButton fullBounds origin - (selectedButton fullBounds extent // 2 * (-1@1))]<br>
&gt;               ifNotNil: [self fullBounds extent // 2].<br>
&gt;       self setConstrainedPosition: pos - offset hangOut: false.<br>
&gt;       oldFocus := aHand keyboardFocus.<br>
&gt;       aHand newMouseFocus: self.<br>
&gt;       aHand newKeyboardFocus: self.<br>
&gt;       savedLabel := selectedButton label.<br>
&gt;       [self isInWorld] whileTrue:[aWorld doOneSubCycle].<br>
&gt;       oldFocus ifNotNil:[aHand keyboardFocus: oldFocus].<br>
&gt;       ^value!<br>
&gt;<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>