A bit of context: For Squeak, I am currently implementing full-fledged handling of DND events sent by the host system. Actually, Squeak only handles `SQDragDrop` at the moment.
However, when logging all received DND events on the image side, I discovered that whenever a file is dropped into the VM, after the last `SQDragMove` an `SQDragLeave` is received before the eventual `SQDragDrop`. This looks very suspicious to me. Neither does the same happen on any other platform (tested on Win32, too), nor does it appear logical to me in any way. If I release the mouse button *over* the image, the drag did not leave, so a "drag leave" should not be recorded.
This MR makes sure that in `dndInDrop()`, an `SQDragLeave` event is only recorded if the drop was not successful. (Please note that the `SQDragDrop` event itself will be sent in a deferred manner; `dndInDrop()` itself only calls `XConvertSelection()` from the X-Server which then will send a `SelectionNotify` which will trigger `dndGetSelection()` and eventually have `generateSqueakDropEventIfDroppedFiles()` called.)
Please review carefully, as I am a bloody VM newbie and this is my very first commit to this repo! :-) Mentioning @eliotmiranda who appears to be the code owner of this plugin, according to the file's history.
Todos: - [ ] Think about backward compatibility: Squeak did not respect any of the drag events but `SQDragDrop` until today, and I'm reworking that handling ATM, so there will be no problem. But are there other users of this plugin that could rely on the old behavior which I consider a bug? Or does the `sq` in the prefix unambiguously stand for `Squeak`? - [ ] Are there any tests I could run to make sure that this change cannot break anything else? You can view, comment on, or merge this pull request online at:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508
-- Commit Summary --
* Fix a typo * Comment out suspicious line * Merge branch 'Cog' into sqUnixXdnd * Refactor changes * Don't skip SQDragLeave if XGetSelectionOwner failed
-- File Changes --
M platforms/unix/vm-display-X11/sqUnixXdnd.c (11)
-- Patch Links --
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.diff
@LinqLover pushed 1 commit.
e2be1e85adaa5da536f665cf4a05655c0a0658da Don't skip SQDragLeave if XGetSelectionOwner failed
Ehm, all the pharo builds are failing. Is this my fault?
@nicolas-cellier-aka-nice Would you mind to have a short look at this? :-)
Concerning Pharo, you did not break anything. External libraries are precompiled on the CI in some cache. When version number of those libraries are update, the cache is not automatically cleared. Therefore, the failure is postponed until the cache is cleared, which happens on a regular schedule apparently.
Concerning sq, we did not want to change each and every prefix to osvm when we switched squeak vm to osvm. It would have touched each and every file and the VMMaker and all plugin repositories, for not much added value. Who knows how many regressions could have been un-noticed. So do not consider sq* as Squeak only.
Concerning DND, it's beyond my skill, I've never studied its logic nor particular sequence of events. What you say sounds logical, and consistent VM behavior is desirable though. So if you say that you compiled, used the VM and saw no regression in an official release (say drop a .png in Squeak 5.3), I can do the merge (and squash).
Ideally we should do it on an old version of pharo too (7?), but at one moment, pharo people shall help us to help them, and this is not the trend. The INRIA team forked, and when I request community help on Opensmalltalk-vm-dev ML, I ear nothing but a big silence, I guess no one is interested. Newspeak sounds less like a problem, because they use their own form of FFI for windows system integration rather than plugin.
@LinqLover pushed 2 commits.
aafdc2837074b859c3d392a3f86b3645b12e91d7 Only record SQDragLeave xor SQDragDrop 4def9a65347638fe002deb5cfb92d00fa532145c Merge remote-tracking branch 'origin/Cog' into sqUnixXdnd
Thank you for the detailed explanations, @nicolas-cellier-aka-nice!
you say that you compiled, used the VM and saw no regression in an official release (say drop a .png in Squeak 5.3)
Yes, I confirm that.
Newspeak sounds less like a problem, because they use their own form of FFI for windows system integration rather than plugin.
What is about Cuis?
consistent VM behavior is desirable though
Hm, please don't merge yet. I just found further small inconsistencies in this implementation I would like to fix within this PR. I will update the description when I am done and mention you again. :-)
Regarding code ownership - there currently is nobody specifically tending to the unix VM, or the X window display system. Most of the code is more than 15 years old, written by Ian Piumarta. Others and I contributed smaller parts over the years. That history got lost when switching from svn to git.
As for DND, at some point around 2007 it was working fully - you could drag pictures and rich text into Squeak (e.g. a paragraph from Wikipedia), and you could drag e.g. a morph out of Squeak into an office document (where it would appear as a bitmap image) or onto another Squeak (where it would appear as fully functioning object, all the scripts etc. were being serialized). The latter part might be why there are squeak-specific DnD events.
This was used for full interoperability inside of the Sugar OS on the OLPC laptop. E.g. you could drag a morph out of Etoys onto the Sugar Frame Clipboard, switch apps, and drag it into the other app. I used to be the maintainer of Squeak/Etoys for Sugar but haven’t touched it in years.
@codefrau This is very interesting to hear! For starters, my goal is to translate every incoming drag into a transfer morph that can be handled natively by any morph. However, reviving the full potential of DnD will be a very interesting follow-up project. If you have further information on how this could break all without anyone noticing, please tell me. :-) Do you know whether all platforms already supported this?
I don't remember if all platforms supported this. Your best bet is to try with Etoys from Squeakland. This one here includes VMs for Win, Mac, and Linux: http://www.squeakland.org/content/installers/Etoys-To-Go-5.0.zip
Which VM version is that? On Windows, DnD works as well as in the latest OSVM. Unfortunately, I cannot find a 64 bit version for Linux, so I cannot test Etoys To Go on Linux ...
Hey @LinqLover, you should be able to get it to run on a 64bit linux as well. When running it will report which libraries are currently not installed in 32bit, on my system this was the only step necessary to get it to run: `sudo apt install libxrender1:i386 libpangocairo-1.0-0:i386`
In general, once you know which libraries cannot be loaded, you can run for example `ldd Contents/Linux-i686/so.vm-display-X11` to see which of its dependencies are missing and then install those via apt-get with the `:i386` suffix.
@tom95 The message only I'm seeing is: ```terminal $ ./etoys.sh ./etoys.sh: line 107: ./Contents/Linux-i686/etoys: cannot execute binary file: Exec format error ``` `ldd` gives me `not a dynamic executable`. Does native Linux support more backward compatibility in terms of architecture than a virtualized Linux? I am using Ubuntu in Windows Subsystem for Linux.
Oh okay, in that case this might be your best bet: https://superuser.com/questions/1407730/run-32-bit-application-on-ubuntu-on-...
@tom95 Great to know that WSL2 supports this. I still have to set up this, thank you :)
Inside Etoys-To-Go are old 32 Bit interpreter VMs, from before Cog was around. You need those to be able to run the Etoys image. On Linux, there used to be a simple way to install the 32 bit support even on a 64 bit system, but I don’t know what the current status is.
That Etoys image might have some more support code for DnD handling than current Squeak. Not everything has been properly integrated back. @timfel did the bulk of that work.
On Wed, Jul 08, 2020 at 10:50:57AM -0700, Vanessa Freudenberg wrote:
Inside Etoys-To-Go are old 32 Bit interpreter VMs, from before Cog was around. You need those to be able to run the Etoys image. On Linux, there used to be a simple way to install the 32 bit support even on a 64 bit system, but I don???t know what the current status is.
That Etoys image might have some more support code for DnD handling than current Squeak. Not everything has been properly integrated back. @timfel did the bulk of that work.
The old interpreter VM in the Etoys-To_Go distribution still works fine on Ubuntu 16.04 LTS. I have 32-bit libraries installed as described in Tom Beckman's earlier reply.
If you want to run Etoys on a native 64-bit VM, follow the instructions at http://wiki.squeak.org/squeak/6354. It takes about 5 or 10 minutes to do this, so allow yourself an hour of free time before you start, because nothing ever goes right the first time
As a side note, Windows does a very good job of providing run-time backward compatibility for old applications, so a Squeak running on a very old Windows VM will almost always work. On Unix systems in general, and Linux in particular, there is very good source-level portability but backward compatibility for old compiled executables is not as good. The supporting runtime libraries tend to get updated regularly, and after 5 or 10 years you can easily end up with a compiled executable with runtime linkages to libraries that are no longer present.
Dave
On 09.07.2020, at 03:17, David T. Lewis lewis@mail.msen.com wrote:
On Wed, Jul 08, 2020 at 10:50:57AM -0700, Vanessa Freudenberg wrote:
Inside Etoys-To-Go are old 32 Bit interpreter VMs, from before Cog was around. You need those to be able to run the Etoys image. On Linux, there used to be a simple way to install the 32 bit support even on a 64 bit system, but I don???t know what the current status is.
That Etoys image might have some more support code for DnD handling than current Squeak. Not everything has been properly integrated back. @timfel did the bulk of that work.
The old interpreter VM in the Etoys-To_Go distribution still works fine on Ubuntu 16.04 LTS. I have 32-bit libraries installed as described in Tom Beckman's earlier reply.
If you want to run Etoys on a native 64-bit VM, follow the instructions at http://wiki.squeak.org/squeak/6354. It takes about 5 or 10 minutes to do this, so allow yourself an hour of free time before you start, because nothing ever goes right the first time
As a side note, Windows does a very good job of providing run-time backward compatibility for old applications, so a Squeak running on a very old Windows VM will almost always work. On Unix systems in general, and Linux in particular, there is very good source-level portability but backward compatibility for old compiled executables is not as good. The supporting runtime libraries tend to get updated regularly, and after 5 or 10 years you can easily end up with a compiled executable with runtime linkages to libraries that are no longer present.
BTW: Fedora ships a 64bit squeak interpreter vm that can run 323bit closure and non-closure images. Except for a broken Rome-plugin, this works very fine for Etoys 5.0…
Best regards -Tobias
On Thu, Jul 09, 2020 at 07:19:32AM +0200, Tobias Pape wrote:
On 09.07.2020, at 03:17, David T. Lewis lewis@mail.msen.com wrote:
On Wed, Jul 08, 2020 at 10:50:57AM -0700, Vanessa Freudenberg wrote:
Inside Etoys-To-Go are old 32 Bit interpreter VMs, from before Cog was around. You need those to be able to run the Etoys image. On Linux, there used to be a simple way to install the 32 bit support even on a 64 bit system, but I don???t know what the current status is.
That Etoys image might have some more support code for DnD handling than current Squeak. Not everything has been properly integrated back. @timfel did the bulk of that work.
The old interpreter VM in the Etoys-To_Go distribution still works fine on Ubuntu 16.04 LTS. I have 32-bit libraries installed as described in Tom Beckman's earlier reply.
If you want to run Etoys on a native 64-bit VM, follow the instructions at http://wiki.squeak.org/squeak/6354. It takes about 5 or 10 minutes to do this, so allow yourself an hour of free time before you start, because nothing ever goes right the first time
As a side note, Windows does a very good job of providing run-time backward compatibility for old applications, so a Squeak running on a very old Windows VM will almost always work. On Unix systems in general, and Linux in particular, there is very good source-level portability but backward compatibility for old compiled executables is not as good. The supporting runtime libraries tend to get updated regularly, and after 5 or 10 years you can easily end up with a compiled executable with runtime linkages to libraries that are no longer present.
BTW: Fedora ships a 64bit squeak interpreter vm that can run 323bit closure and non-closure images. Except for a broken Rome-plugin, this works very fine for Etoys 5.0???
That's interesting, I did not know about that. If you get a chance, could you please check the version information for that VM? Either the contents of a system reporter in the image, or from the command line "/usr/bin/squeak -version" (assuming it is installed in /usr/bin).
At one time there was a Debian package for the interpreter VM, but it was badly broken, so it would be nice to know if someone has been distributing one that works.
Thank you! Dave
On Thu, Jul 9, 2020 at 6:52 AM David T. Lewis lewis@mail.msen.com wrote:
On Thu, Jul 09, 2020 at 07:19:32AM +0200, Tobias Pape wrote:
BTW: Fedora ships a 64bit squeak interpreter vm that can run 323bit
closure and non-closure images.
Except for a broken Rome-plugin, this works very fine for Etoys 5.0???
That's interesting, I did not know about that. If you get a chance, could you please check the version information for that VM? Either the contents of a system reporter in the image, or from the command line "/usr/bin/squeak -version" (assuming it is installed in /usr/bin).
At one time there was a Debian package for the interpreter VM, but it was badly broken, so it would be nice to know if someone has been distributing one that works.
Thank you! Dave
I just found this site, which lists packages for many linux distros:
https://pkgs.org/search/?q=squeak
Fedora has 4.10.2.2614 VMs for 32 bit ARM, 64 bit ARM, and 64 bit x86, it appears.
This matches the last src.tar.gz http://squeakvm.org/unix/release/Squeak-4.10.2.2614-src.tar.gz on http://squeakvm.org/unix/release/
(IIRC it's an automated build that pulls the latest from that site - but I could be mixing that up with Debian)
That site also shows which distros carry etoys and scratch packages.
Vanessa
@LinqLover pushed 2 commits.
1fde7270c5c3c4bbf7e9d33b8594f9e3ac3f8c92 Add explaining comments 33df20b6b4e18c5b827bd3da48be3ba0e1a1dcef Refactor drop event generation
@LinqLover pushed 1 commit.
3100c64c6b770079bdd13888ed8740eff38a8fe7 Improve comments
@LinqLover pushed 1 commit.
2ff21e28c04f97b3250e8001a6befc33e21ca2b7 Nuke obsolete variable
@LinqLover pushed 1 commit.
b992e979b0ddc8f0887e965f411d0a6ca5108282 Revert rejected change
Thanks for all the hints, I will try that soon! However, reviving the full DnD potential will surely happen in separate threads and PRs. This one is ready now, again, at least from my side. Please see the updated description above. I hereby confirm that the latest version again does not show any regressions in an up to date Squeak image. @nicolas-cellier-aka-nice Would you mind to review/squash-merge again as soon as the checks have completed? :-)
@LinqLover pushed 1 commit.
403836b5d07d6036e2855d133d148df9e4602892 Fix a stupid slip
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
I tested compiling this branch 'sqUnixXdnd' on Solaris;
the sqUnixXdnd code seems to compiles but how can I test please ?
In order to compile I have to apply a small patch, but that is always the case. (see PR #496)
It is an interesting topic, to hear and read about the history of the Unix VM and X11 support, which obviously is very much relevant to Solaris.
However when you write "this does not show any regressions in an up to date Squeak image",
what exactly did you test please ?
Currently it seems I can drag a file into Squeak, and this creates as PluggableSystemWindow object.
I don't seem to be able to drag anything out of Squeak.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Actually on further inspection, there seems to exist a variable
if (getenv("SQUEAK_NOXDND")) useXdnd= 0;
when set , this disables the dnd support.
Indeed when export SQUEAK_NOXDND=1, the drag action of a file into Squeak, is not doing anything.
But essentially I wonder (from the discussion) so far, what you are trying, to change with this dnd PR and how I could try to test it.
David Stes
Hi David,
thanks for your interest and sorry for the delay, I was on holiday!
what exactly did you test please ?
As you wrote, you can drag a file into the image and an external drop handler will handle it (or a dialog window will appear if there are multiple handlers). You can also drag multiple files into the image and they will be processed sequentially. So this is the only "acceptance test" I did so far.
From a lower-level perspective, you can manipulate `HandMorph >> #generateDropFilesEvent:` and insert a `Transcript showln: {dragType. numFiles}.` somewhere to watch the exact events generated by the VM. This PR removes duplicate/wrong events from the recorded list. You can also make sure that the following works:
- drag a file over the image, but do not drop it, then drag it away - does the image still work? - after that, drag another file into the image and drop it - is the correct file displayed? - try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
But essentially I wonder (from the discussion) so far, what you are trying, to change with this dnd PR and how I could try to test it.
In the first step, I only cleaned up the list of DND events generated by the X11 OSVM as described in the PR message. Depending on this PR, I am extending `#generateDropFilesEvent:` to also process the `DragMove` and `DragLeave` events. This allows it not only to drag files into the world itself but wrap them into a Squeak-like TransferMorph that can be dropped into morph or tool by reusing the existing `#acceptDroppingMorph:` interface. For example, you can drop a file directly into the Workspace without any other modifications. Marcel's idea! :-)
I don't seem to be able to drag anything out of Squeak.
That's right, it might have worked on some platform in some ancient past, but nowadays it does not appear to work. But this would be interesting next steps, as well as dragging non-file stuff such as text or images into the image. Stay tuned! :-)
Best, Christoph
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I tested the following, with a VM compiled from the sqUnixXdnd branch:
# git remote -v origin https://github.com/LinqLover/opensmalltalk-vm.git (fetch) origin https://github.com/LinqLover/opensmalltalk-vm.git (push) # git branch Cog * sqUnixXdnd
Tested:
1. drag a file over the image, but do not drop it, then drag it away - does the image still work?
Yes it works , the cursor temporarily changes to a 'drag with +' sign when, I drag the file1 over the VM display, and drag it away (without drop), and the Squeak VM continues to function.
2. after that, drag another file into the image and drop it - is the correct file displayed?
Yes, I think so. I have files file1 and file2 and first drag file1 without drop, and then I drag file2, when I drop file2 it displays the file2 path.
3. try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
The cursor changes again to a drag with "+" sign but when I drop the text, which I drag out of an external text editor, nothing seems to happen in Squeak.
The image continues to accept other files after that.
What also seems to work for me is to drag a folder (directory) into Squeak. I get some sort of Unix file browser for the files/directories in that folder (in Squeak).
I think it is an interesting PR (pull request).
But basically I don't understand what you are trying to fix.
But obviously there must exist bugs in there ...
However basically you seem to be "cleaning up" while I don't understand what effective bug you are trying to fix.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I tested the following, with a VM compiled from the sqUnixXdnd branch:
# git remote -v origin https://github.com/LinqLover/opensmalltalk-vm.git (fetch) origin https://github.com/LinqLover/opensmalltalk-vm.git (push) # git branch Cog * sqUnixXdnd
Tested:
1. drag a file over the image, but do not drop it, then drag it away - does the image still work?
Yes it works , the cursor temporarily changes to a 'drag with +' sign when, I drag the file1 over the VM display, and drag it away (without drop), and the Squeak VM continues to function.
2. after that, drag another file into the image and drop it - is the correct file displayed?
Yes, I think so. I have files file1 and file2 and first drag file1 without drop, and then I drag file2, when I drop file2 it displays the file2 path.
3. try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
The cursor changes again to a drag with "+" sign but when I drop the text, which I drag out of an external text editor, nothing seems to happen in Squeak.
The image continues to accept other files after that.
What also seems to work for me is to drag a folder (directory) into Squeak. I get some sort of Unix file browser for the files/directories in that folder (in Squeak).
I think it is an interesting PR (pull request).
But basically I don't understand what you are trying to fix.
But obviously there must exist bugs in there ...
However basically you seem to be "cleaning up" while I don't understand what effective bug you are trying to fix.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I tested the following, with a VM compiled from the sqUnixXdnd branch:
# git remote -v origin https://github.com/LinqLover/opensmalltalk-vm.git (fetch) origin https://github.com/LinqLover/opensmalltalk-vm.git (push) # git branch Cog * sqUnixXdnd
Tested:
1. drag a file over the image, but do not drop it, then drag it away - does the image still work?
Yes it works , the cursor temporarily changes to a 'drag with +' sign when, I drag the file1 over the VM display, and drag it away (without drop), and the Squeak VM continues to function.
2. after that, drag another file into the image and drop it - is the correct file displayed?
Yes, I think so. I have files file1 and file2 and first drag file1 without drop, and then I drag file2, when I drop file2 it displays the file2 path.
3. try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
The cursor changes again to a drag with "+" sign but when I drop the text, which I drag out of an external text editor, nothing seems to happen in Squeak.
The image continues to accept other files after that.
What also seems to work for me is to drag a folder (directory) into Squeak. I get some sort of Unix file browser for the files/directories in that folder (in Squeak).
I think it is an interesting PR (pull request).
But basically I don't understand what you are trying to fix.
But obviously there must exist bugs in there ...
However basically you seem to be "cleaning up" while I don't understand what effective bug you are trying to fix.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I tested the following, with a VM compiled from the sqUnixXdnd branch:
# git remote -v origin https://github.com/LinqLover/opensmalltalk-vm.git (fetch) origin https://github.com/LinqLover/opensmalltalk-vm.git (push) # git branch Cog * sqUnixXdnd
Tested:
1. drag a file over the image, but do not drop it, then drag it away - does the image still work?
Yes it works , the cursor temporarily changes to a 'drag with +' sign when, I drag the file1 over the VM display, and drag it away (without drop), and the Squeak VM continues to function.
2. after that, drag another file into the image and drop it - is the correct file displayed?
Yes, I think so. I have files file1 and file2 and first drag file1 without drop, and then I drag file2, when I drop file2 it displays the file2 path.
3. try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
The cursor changes again to a drag with "+" sign but when I drop the text, which I drag out of an external text editor, nothing seems to happen in Squeak.
The image continues to accept other files after that.
What also seems to work for me is to drag a folder (directory) into Squeak. I get some sort of Unix file browser for the files/directories in that folder (in Squeak).
I think it is an interesting PR (pull request).
But basically I don't understand what you are trying to fix.
But obviously there must exist bugs in there ...
However basically you seem to be "cleaning up" while I don't understand what effective bug you are trying to fix.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I tested the following, with a VM compiled from the sqUnixXdnd branch:
# git remote -v origin https://github.com/LinqLover/opensmalltalk-vm.git (fetch) origin https://github.com/LinqLover/opensmalltalk-vm.git (push) # git branch Cog * sqUnixXdnd
Tested:
1. drag a file over the image, but do not drop it, then drag it away - does the image still work?
Yes it works , the cursor temporarily changes to a 'drag with +' sign when, I drag the file1 over the VM display, and drag it away (without drop), and the Squeak VM continues to function.
2. after that, drag another file into the image and drop it - is the correct file displayed?
Yes, I think so. I have files file1 and file2 and first drag file1 without drop, and then I drag file2, when I drop file2 it displays the file2 path.
3. try to drag some text into the image - this attempt should be rejected but the image should still accept other files after that
The cursor changes again to a drag with "+" sign but when I drop the text, which I drag out of an external text editor, nothing seems to happen in Squeak.
The image continues to accept other files after that.
What also seems to work for me is to drag a folder (directory) into Squeak. I get some sort of Unix file browser for the files/directories in that folder (in Squeak).
I think it is an interesting PR (pull request).
But basically I don't understand what you are trying to fix.
But obviously there must exist bugs in there ...
However basically you seem to be "cleaning up" while I don't understand what effective bug you are trying to fix.
Regards, David Stes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
David.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
David.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
David.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
David.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
David.
Hi David,
thanks for sharing your observations, this fits in with my own results.
By the way I did the same 3 tests with a VM which I compiled from the OpenSmalltalk Cog branch (not from the PR).
I seem to be having the same results.
So there appears not to be any regression.
But basically I don't understand what you are trying to fix.
Here is how you can observe the erroneous under-the-hood behavior this PR aims to fix:
1. In a recent Squeak image, browse `HandMorph >> #generateDropFilesEvent:` and insert the following line after the assignment of `dragType:` ```smalltalk Transcript showln: dragType. ``` 2. Open a Transcript 3. Drag a file into the image
Transcript output on an X11 platform using the latest released plugin version:
``` 1 (dragEnter) 2 (dragMove) 2 (dragMove) ... 2 (dragMove) 3 (dragLeave) 4 (dragDrop) 3 (dragLeave) ```
Transcript when compiling the plugin with the proposed patch applied:
``` 1 (dragEnter) 2 (dragMove) 2 (dragMove) ... 2 (dragMove) 4 (dragDrop) ```
The current image implementation does not care about the additional, false dragLeave events, but my changeset which I am planning to put into the inbox will do so.
Is this comprehensible? 😅
PS: For some reasons all your posts arrive multiple times in the repository. Also, they would be easier to read if you could use codefences (` ``` `) :-)
Best, Christoph
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
First of all, sorry if you receive this multiple times, most likely this is because I click the "Comment" button multiple times.
OK, I modified the HandMorph -> private events -> generateDropFilesEvent: as you indicated, from the Squeak6.0alpha-19793-64bit.image for the tests.
I also tried with Squeak 4, I have the same result when I try with the Squeak4.6-15012 (Squeak 4 VM).
When I drag and drop a file "myfile" into the Squeak window, the Transcript shows:
1 2 2 ... 2 2 3 4 3
and the object for "myfile" is created.
If I drag "myfile" into the Squeak window and then out of it (without drop):
1 2 2 ... 2 2 3
On the other hand if I use the VM, with this pull request, compiled :
First when drag and drop "myfile" :
1 2 2 ... 2 2 4
Then when dragging "myfile" without drop :
1 2 2 ... 2 2 3
So this confirms what you described ...
However to really test this pull request I think it is required to test the code (changeset) which you are planning to put into the "inbox".
Maybe I missed something but in the description of this pull request, you could give a pointer to the changeset you are developing.
Maybe if I can download it from some place, I can test it.
I now realise that you are actually talking about a combination of 2 things.
1. a change in the VM 2. a changeset of some Squeak code that depends on that the VM change
Correct ?
If so, I'd certainly would be interested in trying out the changeset.
Regards, David Stes
Thanks again for testing! :-)
I can share with you a [working copy](https://github.com/OpenSmalltalk/opensmalltalk-vm/files/5098120/dropFiles3.2...) of my changeset, but it is still WIP. However, I am convinced that both changes in VM + image are decoupled enough and do not need to be released together. Even without any image change, I think that the old X11 event generation, saying "dragLeave dragDrop dragLeave" was erroneous by itself.
From my point of view, this PR is ready to merge as stated in July. :-)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I'm just commenting on this out of interest, I cannot say anything on whether this PR is going to be merged, as I have nothing to do with that.
As far as I can see this looks a reasonable change, but we don't know, how the original author(s) think about it, whether they had a reason for their implementation.
But the context of your work is a little bit clearer now to me.
Basically you have dropFiles-examples.13.cs dropFiles3.14.cs changesets.
In my image I can "fileIn" those changesets by Tools->FileList and then clicking "fileIn".
My understanding is now that you need some VM changes/support for the dropFiles3.14.cs changeset, i.e. the underlying VM has some behavior, that you want to change for the dropFiles changes.
If it's useful I can do further testing on this X11 platform, as from what I understand this change is relevant to the Solaris X11 support.
For the moment - this may be a Solaris specific problem - when I test, drag and drop after fileIn of the dropFiles changeset I get the following, in a debugger:
- --- The full stack --- FileDirectory class>>requestDropDirectory: [] in HandMorph>>collectDropFilesAndDirectories: Interval>>collect: HandMorph>>collectDropFilesAndDirectories: HandMorph>>generateDropFilesEvent: HandMorph>>processEvents [] in WorldState>>doOneCycleNowFor: Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: PasteUpMorph>>doOneCycle [] in MorphicProject>>spawnNewProcess [] in FullBlockClosure(BlockClosure)>>newProcess
There may be Solaris specific issues with the FileDirectory I don't know.
David Stes
David,
My understanding is now that you need some VM changes/support for the dropFiles3.14.cs changeset, i.e. the underlying VM has some behavior, that you want to change for the dropFiles changes.
Exactly.
For the moment - this may be a Solaris specific problem - when I test, drag and drop after fileIn of the dropFiles changeset I get the following, in a debugger:
This could be interesting. May I assume that the VM you used was compiled based on this PR? What is the exact error message you see?
I tested PR + changeset both in WSL + VcXsrv and a true Ubuntu VM and it worked fine for me. Maybe it's a Solaris problem, I don't know ...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi,
I compiled the VM from your repository branch "sqUnixXdnd" (I applied one small patch the patch from PR #496 required on Solaris)
It's possible that there is some issue with the Solaris support, as this has not been used for a long time I think, and I'm only recently using it , but it's quite usable.
So when I use that VM and I use the Tools -> File List , I can "fileIn" the changesets that you posted.
Then after that when I drag a file "myfile" into the Squeak desktop, I get into a debugger.
When I right click on the debugger I can select "copy bug report to clipboard".
UndefinedObject(Object)>>error: Receiver: nil Arguments and temporary variables: aString: 'Instances of UndefinedObject are not indexable' Receiver's instance variables: nil
UndefinedObject(Object)>>errorNotIndexable Receiver: nil Arguments and temporary variables:
Receiver's instance variables: nil
UndefinedObject(Object)>>size Receiver: nil Arguments and temporary variables:
Receiver's instance variables: nil
FileDirectory class>>on: Receiver: FileDirectory Arguments and temporary variables: pathString: nil pathName: nil parentName: nil Receiver's instance variables: superclass: Object methodDict: a MethodDictionary(size 125) format: 65537 instanceVariables: #('pathName') organization: ('enumeration' containingDirectory directoryEntries directoryEntry...etc... subclasses: {UnixFileDirectory . AcornFileDirectory . MacFileDirectory . DosFileDirectory...etc... name: #FileDirectory classPool: a Dictionary(#DefaultDirectory->UnixFileDirectory on './stes/s...etc... sharedPools: nil environment: Smalltalk category: #'Files-Directories'
FileDirectory class>>requestDropDirectory: Receiver: FileDirectory Arguments and temporary variables: dropIndex: 1 potentialDirectory: nil Receiver's instance variables: superclass: Object methodDict: a MethodDictionary(size 125) format: 65537 instanceVariables: #('pathName') organization: ('enumeration' containingDirectory directoryEntries directoryEntry...etc... subclasses: {UnixFileDirectory . AcornFileDirectory . MacFileDirectory . DosFileDirectory...etc... name: #FileDirectory classPool: a Dictionary(#DefaultDirectory->UnixFileDirectory on './stes/s...etc... sharedPools: nil environment: Smalltalk category: #'Files-Directories'
[] in HandMorph>>collectDropFilesAndDirectories: Receiver: a HandMorph(1013123) Arguments and temporary variables: <<error during printing> Receiver's instance variables: bounds: 660@444 corner: 676@460 owner: a PasteUpMorph(2434915) [world] submorphs: #() fullBounds: 660@444 corner: 676@460 color: Color blue extension: a MorphExtension (1604074) [eventHandler = an EventHandler] [other:...etc... mouseFocus: nil keyboardFocus: a TextMorphForEditView(3274035) eventListeners: nil mouseListeners: nil keyboardListeners: nil eventCaptureFilters: nil mouseCaptureFilters: nil keyboardCaptureFilters: a WeakArray(a HandMorph(1013123)) mouseClickState: nil mouseOverHandler: a MouseOverHandler targetOffset: 68@9 lastMouseEvent: [660@444 mouseUp ( red ) 111157] damageRecorder: a DamageRecorder cacheCanvas: nil cachedCanvasHasHoles: true temporaryCursor: nil temporaryCursorOffset: nil hardwareCursor: nil hasChanged: true savedPatch: nil userInitials: '' lastEventBuffer: #(1 111157 660 444 0 0 0 1) genieGestureProcessor: nil keyboardInterpreter: an UTF32InputInterpreter externalDropMorph: nil
Interval>>collect: Receiver: (1 to: 1) Arguments and temporary variables: aBlock: [closure] in HandMorph>>collectDropFilesAndDirectories: nextValue: 1 result: #(nil) i: 1 iLimiT: 1 Receiver's instance variables: start: 1 stop: 1 step: 1
HandMorph>>collectDropFilesAndDirectories: Receiver: a HandMorph(1013123) Arguments and temporary variables: numFiles: 1 Receiver's instance variables: bounds: 660@444 corner: 676@460 owner: a PasteUpMorph(2434915) [world] submorphs: #() fullBounds: 660@444 corner: 676@460 color: Color blue extension: a MorphExtension (1604074) [eventHandler = an EventHandler] [other:...etc... mouseFocus: nil keyboardFocus: a TextMorphForEditView(3274035) eventListeners: nil mouseListeners: nil keyboardListeners: nil eventCaptureFilters: nil mouseCaptureFilters: nil keyboardCaptureFilters: a WeakArray(a HandMorph(1013123)) mouseClickState: nil mouseOverHandler: a MouseOverHandler targetOffset: 68@9 lastMouseEvent: [660@444 mouseUp ( red ) 111157] damageRecorder: a DamageRecorder cacheCanvas: nil cachedCanvasHasHoles: true temporaryCursor: nil temporaryCursorOffset: nil hardwareCursor: nil hasChanged: true savedPatch: nil userInitials: '' lastEventBuffer: #(1 111157 660 444 0 0 0 1) genieGestureProcessor: nil keyboardInterpreter: an UTF32InputInterpreter externalDropMorph: nil
HandMorph>>generateDropFilesEvent: Receiver: a HandMorph(1013123) Arguments and temporary variables: evtBuf: #(3 58791 1 803 1 0 1 1) position: 803@1 buttons: 1 modifiers: 0 stamp: 58791 numFiles: 1 dragType: 1 filesAndDirectories: nil oldButtons: nil Receiver's instance variables: bounds: 660@444 corner: 676@460 owner: a PasteUpMorph(2434915) [world] submorphs: #() fullBounds: 660@444 corner: 676@460 color: Color blue extension: a MorphExtension (1604074) [eventHandler = an EventHandler] [other:...etc... mouseFocus: nil keyboardFocus: a TextMorphForEditView(3274035) eventListeners: nil mouseListeners: nil keyboardListeners: nil eventCaptureFilters: nil mouseCaptureFilters: nil keyboardCaptureFilters: a WeakArray(a HandMorph(1013123)) mouseClickState: nil mouseOverHandler: a MouseOverHandler targetOffset: 68@9 lastMouseEvent: [660@444 mouseUp ( red ) 111157] damageRecorder: a DamageRecorder cacheCanvas: nil cachedCanvasHasHoles: true temporaryCursor: nil temporaryCursorOffset: nil hardwareCursor: nil hasChanged: true savedPatch: nil userInitials: '' lastEventBuffer: #(1 111157 660 444 0 0 0 1) genieGestureProcessor: nil keyboardInterpreter: an UTF32InputInterpreter externalDropMorph: nil
HandMorph>>processEvents Receiver: a HandMorph(1013123) Arguments and temporary variables: evt: nil evtBuf: #(3 58791 1 803 1 0 1 1) type: 3 hadAny: false Receiver's instance variables: bounds: 660@444 corner: 676@460 owner: a PasteUpMorph(2434915) [world] submorphs: #() fullBounds: 660@444 corner: 676@460 color: Color blue extension: a MorphExtension (1604074) [eventHandler = an EventHandler] [other:...etc... mouseFocus: nil keyboardFocus: a TextMorphForEditView(3274035) eventListeners: nil mouseListeners: nil keyboardListeners: nil eventCaptureFilters: nil mouseCaptureFilters: nil keyboardCaptureFilters: a WeakArray(a HandMorph(1013123)) mouseClickState: nil mouseOverHandler: a MouseOverHandler targetOffset: 68@9 lastMouseEvent: [660@444 mouseUp ( red ) 111157] damageRecorder: a DamageRecorder cacheCanvas: nil cachedCanvasHasHoles: true temporaryCursor: nil temporaryCursorOffset: nil hardwareCursor: nil hasChanged: true savedPatch: nil userInitials: '' lastEventBuffer: #(1 111157 660 444 0 0 0 1) genieGestureProcessor: nil keyboardInterpreter: an UTF32InputInterpreter externalDropMorph: nil
[] in WorldState>>doOneCycleNowFor: Receiver: a WorldState Arguments and temporary variables: <<error during printing> Receiver's instance variables: hands: {a HandMorph(1013123)} activeHand: a HandMorph(1013123) viewBox: 0@0 corner: 1008@680 canvas: a FormCanvas on: DisplayScreen(1008x680x32) damageRecorder: a DamageRecorder stepList: a Heap(StepMessage(#onBlinkCursor -> a TextMorphForEditView(3274035))...etc... lastStepTime: 3775378560621 lastStepMessage: nil lastCycleTime: 3775378560643 commandHistory: a CommandHistory alarms: a MorphicAlarmQueue lastAlarmTime: 3775378560621 remoteServer: nil multiCanvas: nil interCycleDelay: a Delay(20 msecs)
Array(SequenceableCollection)>>do: Receiver: {a HandMorph(1013123)} Arguments and temporary variables: aBlock: [closure] in WorldState>>doOneCycleNowFor: index: 1 indexLimiT: 1 Receiver's instance variables: {a HandMorph(1013123)}
WorldState>>handsDo: Receiver: a WorldState Arguments and temporary variables: aBlock: [closure] in WorldState>>doOneCycleNowFor: Receiver's instance variables: hands: {a HandMorph(1013123)} activeHand: a HandMorph(1013123) viewBox: 0@0 corner: 1008@680 canvas: a FormCanvas on: DisplayScreen(1008x680x32) damageRecorder: a DamageRecorder stepList: a Heap(StepMessage(#onBlinkCursor -> a TextMorphForEditView(3274035))...etc... lastStepTime: 3775378560621 lastStepMessage: nil lastCycleTime: 3775378560643 commandHistory: a CommandHistory alarms: a MorphicAlarmQueue lastAlarmTime: 3775378560621 remoteServer: nil multiCanvas: nil interCycleDelay: a Delay(20 msecs)
WorldState>>doOneCycleNowFor: Receiver: a WorldState Arguments and temporary variables: aWorld: a PasteUpMorph(2434915) [world] capturingGesture: #(false) Receiver's instance variables: hands: {a HandMorph(1013123)} activeHand: a HandMorph(1013123) viewBox: 0@0 corner: 1008@680 canvas: a FormCanvas on: DisplayScreen(1008x680x32) damageRecorder: a DamageRecorder stepList: a Heap(StepMessage(#onBlinkCursor -> a TextMorphForEditView(3274035))...etc... lastStepTime: 3775378560621 lastStepMessage: nil lastCycleTime: 3775378560643 commandHistory: a CommandHistory alarms: a MorphicAlarmQueue lastAlarmTime: 3775378560621 remoteServer: nil multiCanvas: nil interCycleDelay: a Delay(20 msecs)
WorldState>>doOneCycleFor: Receiver: a WorldState Arguments and temporary variables: aWorld: a PasteUpMorph(2434915) [world] Receiver's instance variables: hands: {a HandMorph(1013123)} activeHand: a HandMorph(1013123) viewBox: 0@0 corner: 1008@680 canvas: a FormCanvas on: DisplayScreen(1008x680x32) damageRecorder: a DamageRecorder stepList: a Heap(StepMessage(#onBlinkCursor -> a TextMorphForEditView(3274035))...etc... lastStepTime: 3775378560621 lastStepMessage: nil lastCycleTime: 3775378560643 commandHistory: a CommandHistory alarms: a MorphicAlarmQueue lastAlarmTime: 3775378560621 remoteServer: nil multiCanvas: nil interCycleDelay: a Delay(20 msecs)
PasteUpMorph>>doOneCycle Receiver: a PasteUpMorph(2434915) [world] Arguments and temporary variables:
Receiver's instance variables: bounds: 0@0 corner: 1008@680 owner: nil submorphs: {a PluggableSystemWindow<Error: Instances of UndefinedObject are not...etc... fullBounds: 0@0 corner: 1008@680 color: (Color r: 0.251 g: 0.259 b: 0.267) extension: a MorphExtension (931082) [eventHandler = an EventHandler] [other: ...etc... borderWidth: 0 borderColor: (Color r: 0.515 g: 0.181 b: 0.263) presenter: an EtoysPresenter (3945455) model: a MorphicModel(3522854) cursor: 1 padding: 3 backgroundMorph: nil turtleTrailsForm: nil turtlePen: nil lastTurtlePositions: nil isPartsBin: nil indicateCursor: nil wantsMouseOverHalos: nil worldState: a WorldState griddingOn: nil
[] in MorphicProject>>spawnNewProcess Receiver: a MorphicProject (HomeProject) in a PasteUpMorph(2434915) [world] Arguments and temporary variables:
Receiver's instance variables: dependents: nil world: a PasteUpMorph(2434915) [world] uiManager: a MorphicUIManager changeSet: a ChangeSet named HomeProject transcript: a TranscriptStream parentProject: a MVCProject (RootProject) in a ControlManager previousProject: nil displayDepth: 32 viewSize: 151@132 thumbnail: Form(151x132x32) nextProject: nil projectParameters: an IdentityDictionary(#PrevailingProjectFlags->an IdentityDictionary...etc... version: nil urlList: nil lastDirectory: nil lastSavedAtSeconds: nil projectPreferenceFlagDictionary: an IdentityDictionary(#showSharedFlaps->true #showWorldMainDockingBar...etc... resourceManager: a ResourceManager uiProcess: a Process in nil
[] in FullBlockClosure(BlockClosure)>>newProcess Receiver: [closure] in MorphicProject>>spawnNewProcess Arguments and temporary variables:
Receiver's instance variables: outerContext: MorphicProject>>spawnNewProcess startpcOrMethod: ([] in MorphicProject>>#spawnNewProcess "a CompiledBlock(15491...etc... numArgs: 0 receiver: a MorphicProject (HomeProject) in a PasteUpMorph(2434915) [world]
- --- The full stack --- UndefinedObject(Object)>>error: UndefinedObject(Object)>>errorNotIndexable UndefinedObject(Object)>>size FileDirectory class>>on: FileDirectory class>>requestDropDirectory: [] in HandMorph>>collectDropFilesAndDirectories: Interval>>collect: HandMorph>>collectDropFilesAndDirectories: HandMorph>>generateDropFilesEvent: HandMorph>>processEvents [] in WorldState>>doOneCycleNowFor: Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: PasteUpMorph>>doOneCycle [] in MorphicProject>>spawnNewProcess [] in FullBlockClosure(BlockClosure)>>newProcess
However it's possible that the changeset is using some functionality, that is somehow not working well on Solaris, so perhaps it can be independently tested (unrelated to the changes to the VM or the changeset for dropFile).
That's possible ...
Is it correct to assume that the problem is somehwere in
requestDropDirectory: dropIndex
| potentialDirectory | potentialDirectory := self on: (FileStream primDropRequestFileName: dropIndex). ^ potentialDirectory exists ifTrue: [potentialDirectory]
The method on: with the FileStream seems to raise an error for me. David Stes
Oh, I just have realized that I forgot to mention that #514 is another dependency of the changeset. Would you mind to merge it as well into your working copy and compiling the VM again? 😅
Merged #508 into Cog.
@cstes Sorry for the delay, Marcel was so kind to merge this by now. I resolved the conflict in #514. Feel free to compile again based on #514 and tell me whether it works for you :-)
vm-dev@lists.squeakfoundation.org