Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropPlugin: Unify numFiles fallback value before DragDrop has been recorded #514

Merged
merged 2 commits into from
Sep 2, 2020

Conversation

LinqLover
Copy link
Contributor

This PR aligns the default numFiles value recorded for DragEnter, DragMove, and DragLeave events recorded by the X11 implementation of the DropPlugin, which was 1, to the default value used by the Win32 implementation of the plugin, which is 0.

The motivation for this change is to unify the event protocol along with different platforms. It would technically be highly expensive and questionable to find out this value before the drop event has been recorded. Concretely, Win32 does not support this at all without switching the library, and on Linux, this would require a performance-extensive ping-pong of "Target to source: Please hand a copy of all dragged files", "Source to target: I converted these files for you", "Target to source: Thank you, but I was only interested into their total number" messages. (However, interestingly macOS appears to support this (I could not yet test it) and https://github.com/codefrau/SqueakJS/ could do so, too.)

While pursuing the same master plan, this PR is not dependent nor reverse-dependent on #508. They can be merged independently of each other.

Please review and merge if you agree. I hereby confirm that I did not observe any regressions when dragging files or folders into a recent Squeak image.

Instead, set numFiles= 0 analogously to the Win32 implementation of the
plugin.
@cstes
Copy link
Contributor

cstes commented Aug 21, 2020

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello,

I've tried building from the "dnd-unify-numfiles" branch.

This works for me : I can compile a "squeak-stack-spur" VM from it,
and when I drag a file into the Squeak desktop, this works,
I don't get into the debugger as I currently have with the sqUnixXdnd branch.

However when I try to merge dnd-unify-numfiles into sqUnixXdnd I get
Auto-merging platforms/unix/vm-display-X11/sqUnixXdnd.c
CONFLICT (content): Merge conflict in platforms/unix/vm-display-X11/sqUnixXdnd.c
Automatic merge failed; fix conflicts and then commit the result.

So is it please possible that you merge yourself and advise on what change
you really want to make to sqUnixXdnd.c ?

Also is there documentation on the dropFiles changeset on how to use the
new class DemoDropTool, subclass of Model.

This would be useful to see how I can test the DemoDropTool.

Regards,
David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJfP3zkAAoJEAwpOKXMq1MarjkH/1CVvbshbyyiPh5VeLsCEVAs
PcL1JR0YyM/4wzmlIu8PaWyfMICLRh43V1TIXT6gBD1iB/2D30LIdN4Y/20lkJY8
k6W3fqYbQOm5alKw53bq6oobS2brscFThP2mqGJtcObf0NVNBLmmb9lPW++bXUdQ
A7KINPCz6kXd/fOcgJMzC9oRXLLJq/wvs2w6MWP69+mBSesIyzAXtgkcde2lbX9G
PK+StOk3bjbCSz8TbdlTBE+KQ5FFhigoJIsOOeM7CrSEKWlg0rZIrt+8itLhxdpp
0yro6iPRpjju4uVIBuN/0zxN2K8GlCMUtwT7parnbKI5Jb2kbExX0OXn0E7C33k=
=v6j1
-----END PGP SIGNATURE-----

@LinqLover
Copy link
Contributor Author

So is it please possible that you merge yourself

Done

Also is there documentation on the dropFiles changeset on how to use the new class DemoDropTool, subclass of Model.

Good hint! Just do ToolBuilder open. DemoDropTool and then try to drop things into the tool. It's really only a demo made to show the different drop hooks we have got.

@cstes
Copy link
Contributor

cstes commented Aug 22, 2020

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I compiled a new VM from the updated branch:

squeak -version

5.0-202008211759-dnd-unify-numfiles Sat Aug 22 09:57:02 CEST 2020 cc [Production Spur 64-bit VM]

StackInterpreter VMMaker.oscog-eem.2792 uuid: f914b421-12d3-48b8-b510-833495378c66 Aug 22 2020

VM: 202008211759-dnd-unify-numfiles stes@gecko:src/thiede/opensmalltalk

Date: Fri Aug 21 19:59:53 2020 CommitHash: dae0bf5

Plugins: 202008211759-dnd-unify-numfiles stes@gecko:src/thiede/opensmalltalk

Then I used the image Squeak6.0alpha-19687-64bit.image.
I loaded (with Tools -> File List "FileIn") the changeset DropFiles3.14.cs
(and DropFiles-examples.cs).

When I drag and drop 2 files myfile1 and myfile2 into the Squeak desktop,
it works, I get "PluggableSystemWindow" objects without getting into the
debugger.

If I then (following your previous instructions) browse HandMorph,
and go to private events #generateDropFilesEvent: and insert the showln:

and when I then drag again the files, it works (without debugger), and
the Transcript shows:

1
2
...
2
2
4

So that seems to work.

Can you explain more how to use the DemoDropTool ?
How to open the ToolBuilder and get from there to the DemoDropTool ...

Regards,
David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJfQNVuAAoJEAwpOKXMq1Mal6YIAKVbbsAyJWhW6jZF2MTZ4vCV
CB7R9mZBmRbSCcF6QD5bUfzq5CXBsnEaQWuswdupdfyEzlUK1l/3vmQUhIiRHFYN
i5X9YQdwb5wvbuHMr346zRQoRACMPlWOQnUTXJn42TGHmKKrSa1ug+wZEVcmb3Bo
Z1KheFmCERjkbv4lcb8KERKG5RfdoZyy+MIQnEoBVLNIyx3CVIRlGXVKXet1s47/
yi0g/B2MKBnhYEopDXAGJrio4+KadnNrKxQVhgBsJJxIdgciFOnCFHXfkEPEE0hi
NtlEuQalotcl2MhQjobMbRmZwgyLtOKqrkysPoTxULN1/CL4fWfjX29DR2rx1mM=
=JKWg
-----END PGP SIGNATURE-----

1 similar comment
@cstes
Copy link
Contributor

cstes commented Aug 22, 2020

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I compiled a new VM from the updated branch:

squeak -version

5.0-202008211759-dnd-unify-numfiles Sat Aug 22 09:57:02 CEST 2020 cc [Production Spur 64-bit VM]

StackInterpreter VMMaker.oscog-eem.2792 uuid: f914b421-12d3-48b8-b510-833495378c66 Aug 22 2020

VM: 202008211759-dnd-unify-numfiles stes@gecko:src/thiede/opensmalltalk

Date: Fri Aug 21 19:59:53 2020 CommitHash: dae0bf5

Plugins: 202008211759-dnd-unify-numfiles stes@gecko:src/thiede/opensmalltalk

Then I used the image Squeak6.0alpha-19687-64bit.image.
I loaded (with Tools -> File List "FileIn") the changeset DropFiles3.14.cs
(and DropFiles-examples.cs).

When I drag and drop 2 files myfile1 and myfile2 into the Squeak desktop,
it works, I get "PluggableSystemWindow" objects without getting into the
debugger.

If I then (following your previous instructions) browse HandMorph,
and go to private events #generateDropFilesEvent: and insert the showln:

and when I then drag again the files, it works (without debugger), and
the Transcript shows:

1
2
...
2
2
4

So that seems to work.

Can you explain more how to use the DemoDropTool ?
How to open the ToolBuilder and get from there to the DemoDropTool ...

Regards,
David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJfQNVuAAoJEAwpOKXMq1Mal6YIAKVbbsAyJWhW6jZF2MTZ4vCV
CB7R9mZBmRbSCcF6QD5bUfzq5CXBsnEaQWuswdupdfyEzlUK1l/3vmQUhIiRHFYN
i5X9YQdwb5wvbuHMr346zRQoRACMPlWOQnUTXJn42TGHmKKrSa1ug+wZEVcmb3Bo
Z1KheFmCERjkbv4lcb8KERKG5RfdoZyy+MIQnEoBVLNIyx3CVIRlGXVKXet1s47/
yi0g/B2MKBnhYEopDXAGJrio4+KadnNrKxQVhgBsJJxIdgciFOnCFHXfkEPEE0hi
NtlEuQalotcl2MhQjobMbRmZwgyLtOKqrkysPoTxULN1/CL4fWfjX29DR2rx1mM=
=JKWg
-----END PGP SIGNATURE-----

@LinqLover
Copy link
Contributor Author

LinqLover commented Aug 22, 2020

Can you explain more how to use the DemoDropTool ?
How to open the ToolBuilder and get from there to the DemoDropTool ...

The ToolBuilder is not a tool but a class that can build tools for you.
The correct snippet is:

ToolBuilder open: DemoDropTool.

Insert this into any text field and press d to do it.

@cstes
Copy link
Contributor

cstes commented Aug 22, 2020

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

This results in a doesNotUnderstand: message for DemoDropTool,
it does not recognize the #buildListWith: selector.

Does it work for you ?

I get

  • --- The full stack ---
    DemoDropTool(Object)>>doesNotUnderstand: #buildListWith:
    [] in DemoDropTool>>buildWith:
    [] in DemoDropTool(Model)>>buildWindowWith:specs:
    Array(SequenceableCollection)>>do:
    DemoDropTool(Model)>>buildWindowWith:specs:
    DemoDropTool>>buildWith:
    DemoDropTool class(Model class)>>buildWith:
    MorphicToolBuilder(ToolBuilder)>>build:
    MorphicToolBuilder>>open:
    ToolBuilder class>>open:

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJfQUCzAAoJEAwpOKXMq1Ma68cH/RmTsvmtMaSpoGXaddKM/Ez9
WLqsGE3FQZboHGJ+D9wV6mDB/wIfH9r8pqv93VeHHPeX5g2M76MAF/2KlUzey6KL
RkKvxtAOtVxyWyzL2CdSQnwjIcRmuzLnkg05x2HODbWEuHWmib7yzH9+XZhBfbDm
67qaiDC+MXnP2ETlJ5G0zgMkAbByYdiIN1iPLv//dKz/Vxj6ZE/fFK7HUupm2tDa
NszB5Y8r1fdZsvSzzYbin0878h9DJoqwWiVKaRgfx3+4CSr0hUDZL9yss5OTJA6C
QbSfD6Nxo5i4jdPF/EIWvV4ORnvlrKkEx5CLLgMHAMcypJxN1RG/ekCRu6uOQns=
=uAio
-----END PGP SIGNATURE-----

@LinqLover
Copy link
Contributor Author

Oh, so sorry, I have no idea how this method has flown off my changeset. :-( If you still have patience, you could try this one:
dropFiles3.31.zip

@cstes
Copy link
Contributor

cstes commented Aug 23, 2020

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This new package dropFiles is working: ToolBuilder open:DemoDropTool
works, it displays some numbers (1 ... 10) although I'm not sure how to use it.

In any case the VM with dnd-unify-numfiles seems to be working.

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJfQiYvAAoJEAwpOKXMq1Ma8fkH/2kuQkoWRehBEpttp3/VNM9c
4QoYMRhRAHRlr/flGMZgNpWSGtEOZIrZdSAz8+Y0YBKEz6s7vV3sX46/mxb2TNP0
k6RZ5oNL/bWhoCAteEzIK0WXWRWWTpZLai6nScntc5kg5u2uvrH6m2VzjRJaKp3b
qGX7//OeF/3gVWX+l9PNf+oPM7jMui/KlAE+XIfN+9BwaTsGDRgMV4HMS9vsyMcz
dYYAUmd5tyfOKVHPXuqcFvihqmx6xP5m/9ptP4nx6vyf9ck4Xj28rCbj97JucaNm
0dQoUO0Z8Vnbct7OcAmzhLAPS2yQ08EAiRLf1BDrNZlAtDY2R53HKzgbGz1Uvw4=
=Emqj
-----END PGP SIGNATURE-----

@LinqLover
Copy link
Contributor Author

You can use the DemoDropTool by dragging objects into each of the three panes, and to show that the drop works, it displays each dragged items. For example, try to drag a text to number 5 of the list and the 5 will be replaced by the text. Together with this PR, you can drag a file from the host system directly in this tool.

@LinqLover
Copy link
Contributor Author

@marceltaeumel @nicolas-cellier-aka-nice Friendly reminder that this PR is complete, conflict-free, and ready to merge :-)

@marceltaeumel marceltaeumel merged commit fc9c317 into OpenSmalltalk:Cog Sep 2, 2020
@LinqLover LinqLover deleted the dnd-unify-numfiles branch October 22, 2020 20:52
hogoww referenced this pull request in hogoww/opensmalltalk-vm Dec 23, 2021
hogoww referenced this pull request in hogoww/opensmalltalk-vm Dec 23, 2021
…od [ postBecomeScanClassTable: ] KILLED by 1/3 test cases.
hogoww referenced this pull request in hogoww/opensmalltalk-vm Feb 26, 2022
… false ] on method [ fetchClassOfNonImm: ] 9 test cases.
hogoww referenced this pull request in hogoww/opensmalltalk-vm Feb 26, 2022
…false ] on method [ fetchClassOfNonImm: ] 9/9 test case are EQUIVALENT
guillep pushed a commit to tesonep/opensmalltalk-vm that referenced this pull request May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants