<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>do you really think that it would be a good idea to couple HandMorph directly to MorphicProject? I always thought the world should be the only object to communicate with the world - except for accessing a small set of global interfaces such as #world, #addDeferredUIMessage:
 and #uiManager. :-)</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">Best,</div>
<div class="_rp_T4" id="Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 18. November 2020 09:48:41<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Morphic-ct.1715.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph.
<div><br>
</div>
<div>> <span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Re-enables handling of #launchDrop events ...</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">It still looks like a proposal of having PasteUpMorph >> #launchSystemEventFiles:event: to me. :-) I would rather like to see such a send happen to the current project, not the world.</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 17.11.2020 20:26:13 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">Christoph Thiede uploaded a new version of Morphic to project The Inbox:<br>
http://source.squeak.org/inbox/Morphic-ct.1715.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-ct.1715<br>
Author: ct<br>
Time: 17 November 2020, 8:25:42.546431 pm<br>
UUID: 4a1a9a9f-9ae1-0640-9f18-17e3c956fa0c<br>
Ancestors: Morphic-mt.1713<br>
<br>
Re-enables handling of #launchDrop events when the VM is configured as a singleton and has been invoked again, though currently only handled with a rudimentary fallback implementation.<br>
<br>
See http://forum.world.st/Changeset-Enhanced-integration-of-drag-n-drop-from-host-tp5123857p5124332.html. Thanks to Jakob (jr) for the feedback!<br>
<br>
=============== Diff against Morphic-mt.1713 ===============<br>
<br>
Item was changed:<br>
----- Method: HandMorph>>generateDropFilesEvent: (in category 'private events') -----<br>
generateDropFilesEvent: evtBuf <br>
"Generate the appropriate mouse event for the given raw event buffer."<br>
<br>
| position buttons modifiers stamp numFiles dragType |<br>
stamp := evtBuf second.<br>
stamp = 0 ifTrue: [stamp := Time eventMillisecondClock].<br>
dragType := evtBuf third.<br>
position := evtBuf fourth @ evtBuf fifth.<br>
buttons := MouseEvent redButton. "hacked because necessary for correct mouseMoveDragging handling"<br>
modifiers := evtBuf sixth.<br>
buttons := buttons bitOr: (modifiers bitShift: 3).<br>
numFiles := evtBuf seventh.<br>
<br>
dragType caseOf: {<br>
[1] -> [ "dragEnter"<br>
externalDropMorph := TransferMorph new<br>
dragTransferType: #filesAndDirectories;<br>
source: self;<br>
passenger: (numFiles = 0 "Usually, numFiles and drop paths are delivered on dragDrop only. Still reserving this possibility for able host implementations."<br>
ifTrue: [self flag: #vmCapabilityMissing. 'Unknown host content' translated]<br>
ifFalse: [self collectDropFilesAndDirectories: numFiles]);<br>
yourself.<br>
<br>
"During the drag operation, the host system is responsible for displaying the cursor."<br>
self grabMorph: externalDropMorph.<br>
self showTemporaryCursor: Cursor blank.<br>
externalDropMorph bottomRight: self topLeft. "Southeast area of the cursor is blocked by drawings from the source application. Display our drop morph at the opposite corner of the cursor." ].<br>
[2] -> [ "dragMove"<br>
^ MouseMoveEvent new <br>
setType: #mouseMove<br>
startPoint: self position<br>
endPoint: position<br>
trail: "{self position. position}"(self mouseDragTrailFrom: evtBuf)<br>
buttons: buttons<br>
hand: self<br>
stamp: stamp ].<br>
[3] -> [ "dragLeave"<br>
externalDropMorph ifNotNil: #abandon.<br>
externalDropMorph := nil.<br>
self showTemporaryCursor: nil ].<br>
[4] -> [ "dragDrop"<br>
+ | oldButtons event |<br>
+ oldButtons := lastEventBuffer fifth<br>
+ bitOr: (lastEventBuffer sixth bitShift: 3).<br>
+ event := MouseButtonEvent new <br>
+ setType: #mouseUp<br>
+ position: position<br>
+ which: (oldButtons bitXor: buttons)<br>
+ buttons: buttons<br>
+ nClicks: 0<br>
+ hand: self<br>
+ stamp: stamp.<br>
+ <br>
- | oldButtons |<br>
externalDropMorph ifNil: [<br>
+ "dragDrop has been sent without prior dragging. This happens when the VM is configured as singleton application and has been invoked again with a new image file (aka #launchDrop, runAsSingleInstance on Unix, or RunSingleApp on Windows)."<br>
+ self flag: #forLater. "ct: When we decouple event generation from Morphic, we will probably need to introduce a separate SystemLaunchEvent class for this event. See http://forum.world.st/Changeset-Enhanced-integration-of-drag-n-drop-from-host-tp5123857p5124332.html."<br>
+ self world<br>
+ launchSystemFiles: (self collectDropFilesAndDirectories: numFiles)<br>
+ event: event.<br>
+ ^ nil].<br>
- "dragDrop has been sent without prior dragging. This happens when the VM is configured as singleton application and has been called again (aka #launchDrop)."<br>
- ^ self error: 'Launch drop for singleton Squeak not yet implemented.'].<br>
<br>
self showTemporaryCursor: nil.<br>
externalDropMorph passenger isString ifTrue: [<br>
self flag: #vmCapabilityMissing. "See above."<br>
externalDropMorph passenger: (self collectDropFilesAndDirectories: numFiles)].<br>
externalDropMorph := nil.<br>
<br>
(Smalltalk classNamed: #DropFilesEvent) ifNotNil: [:eventClass |<br>
| classicEvent |<br>
"Generate classic DropFilesEvent, providing backward compatibility."<br>
classicEvent := eventClass new<br>
setPosition: position<br>
contents: numFiles<br>
hand: self.<br>
self processEvent: classicEvent.<br>
classicEvent wasHandled ifTrue: [^ nil]].<br>
<br>
+ ^ event ].<br>
- oldButtons := lastEventBuffer fifth<br>
- bitOr: (lastEventBuffer sixth bitShift: 3).<br>
- ^ MouseButtonEvent new <br>
- setType: #mouseUp<br>
- position: position<br>
- which: (oldButtons bitXor: buttons)<br>
- buttons: buttons<br>
- nClicks: 0<br>
- hand: self<br>
- stamp: stamp ].<br>
[5] -> [ "drag request"<br>
"For dnd out. Not properly implemented at the moment."<br>
self shouldBeImplemented] }.<br>
^ nil!<br>
<br>
Item was added:<br>
+ ----- Method: PasteUpMorph>>launchSystemFiles:event: (in category 'event handling') -----<br>
+ launchSystemFiles: fileStreams event: anEvent<br>
+ "Handle a number of files the singleton VM was invoked with again."<br>
+ <br>
+ self flag: #todo. "Do something more useful with the image here, e. g. tell the VM to load it."<br>
+ ^ self dropFiles: fileStreams event: anEvent!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</body>
</html>