The Trunk: Files-eem.184.mcz

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

The Trunk: Files-eem.184.mcz

commits-2
Eliot Miranda uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-eem.184.mcz

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

Name: Files-eem.184
Author: eem
Time: 29 November 2020, 10:24:50.876717 am
UUID: 453a229c-9b4d-4acb-b8ba-c0688fc17020
Ancestors: Files-pre.183

Add a guard to FileDirectory class>>requestDropDirectory:.  Every time I connect my headphone buds I get an MNU because primDropRequestFileName: answers nil.  This squashes the MNU.

=============== Diff against Files-pre.183 ===============

Item was changed:
  ----- Method: FileDirectory class>>requestDropDirectory: (in category 'dnd requests') -----
  requestDropDirectory: dropIndex
 
+ ^(FileStream primDropRequestFileName: dropIndex) ifNotNil:
+ [:dropFileDirdectoryName| | potentialDirectory |
+ potentialDirectory := self on: dropFileDirdectoryName.
+ potentialDirectory exists ifTrue: [potentialDirectory]]!
- | potentialDirectory |
- potentialDirectory := self on: (FileStream primDropRequestFileName: dropIndex).
- ^ potentialDirectory exists ifTrue: [potentialDirectory]
- !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Files-eem.184.mcz

Christoph Thiede
That's interesting. The VM generates a drag'n'drop event when a new (USB?)
device is plugged in? Why??? :-)

Best,
Christoph



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Files-eem.184.mcz

Eliot Miranda-2


On Tue, Jan 5, 2021 at 4:16 PM Christoph Thiede <[hidden email]> wrote:
That's interesting. The VM generates a drag'n'drop event when a new (USB?)
device is plugged in? Why??? :-)

Because the Mac delivers notifications of insertion of USB devices via Drag & Drop events.  Since this notification is potentially useful it's better to have primDropRequestFileName: filter out the misunderstood event than have the VM not deliver the event in the first place.  I'm extending the DropPlugin with support for primDropRequestURI: and then different kinds of notifications come in as having different URL schemes.  This means that EventSensor can do the filtering, which should be nicer.  Give us a few days to deliver this.

_,,,^..^,,,_
best, Eliot