<body><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></body>