Robbert van der Helm
2f8bb7ef06
Only allow a single XDND operation at a time
...
MT-PowerDrumkit apparently cancels its drag-and-drop operations and then
immediately starts a new one.
2021-07-12 12:35:07 +02:00
Robbert van der Helm
a478436af6
Make sure the Windows dnd operation terminates
...
I've seen a weird edge case where this doesn't happen once, but i
haven't been able to reproduce it. Hopefully this fixes it.
2021-07-12 12:21:52 +02:00
Robbert van der Helm
11d3ec9010
Also change cursor with the last status message
...
The idea was that you wouldn't be able to see it anyways, but it feels
better this way.
2021-07-11 21:40:42 +02:00
Robbert van der Helm
4d74963e0a
Flush any spooled XDND messages
...
The last position change message would never reach REAPER under when
using certain plugins because we forgot the flush.
2021-07-11 21:35:39 +02:00
Robbert van der Helm
4c7ffd5a3a
Fix emphasis in changelog
2021-07-11 20:32:06 +02:00
Robbert van der Helm
1b4c4ecfad
Remove old warning
2021-07-11 19:43:53 +02:00
Robbert van der Helm
c968a357f6
Fall back to HDROP with empty format enumerator
...
This happens with MeldaProduction plugins.
2021-07-11 19:29:15 +02:00
Robbert van der Helm
b1b47ec80d
Allow dragging to the right and bottom of plugins
2021-07-11 18:48:32 +02:00
Robbert van der Helm
ca5a7b2b96
Continue polling while LMB is held
...
Instead of while the tracker window is alive. Technically the plugin may
clean up their files after the tracker window is gone, but in practice I
haven't seen it happen.
2021-07-11 18:34:26 +02:00
Robbert van der Helm
1c84c4a02a
Mention Wine->X11 drag-and-drop in the changelog
2021-07-11 17:40:06 +02:00
Robbert van der Helm
d21073f866
Escape spaces in URI encoding
2021-07-11 17:24:53 +02:00
Robbert van der Helm
312debc447
URL encode paths in XDND text/uri-list
...
This should fix drag-and-drop in Bitwig.
2021-07-11 17:21:35 +02:00
Robbert van der Helm
d7dc0529a8
URL encode paths in desktop notifications
2021-07-11 17:19:48 +02:00
Robbert van der Helm
83951200bb
Add a function for URL encoding file paths
2021-07-11 17:19:45 +02:00
Robbert van der Helm
64fbabd8ce
Canonicalize paths during drag-and-drop
...
Otherwise we will get a path from somewhere in `$WINEPREFIX/dosdevices`.
2021-07-11 17:03:53 +02:00
Robbert van der Helm
bfaac67cbc
End every URI with a line feed
...
Bitwig requires this.
2021-07-11 16:53:38 +02:00
Robbert van der Helm
8d94abb257
Only send the drop once
...
Oops.
2021-07-11 16:30:28 +02:00
Robbert van der Helm
a12215de3c
Fix URI list length
...
Apparently you're _not_ supposed to count the trailing lien feed. This
would cause REAPER to freeze.
2021-07-11 16:30:21 +02:00
Robbert van der Helm
8e29b5edf3
Make sure the drop actually goes through
...
The whole dropping code was nested in the wrong loop (oops), and we also
forgot to send any last spooled messages. We now also use a pair of
booleans instead of an optional boolean here because it makes the
conditionals a bit more readable.
2021-07-11 15:55:34 +02:00
Robbert van der Helm
f6d661cd35
Fix the timeout
2021-07-11 15:28:14 +02:00
Robbert van der Helm
7bac138240
Spool XdndPosition messages
...
In accordance to the spec.
2021-07-11 15:28:01 +02:00
Robbert van der Helm
0e0b120eda
Perform the actual drop after releasing the button
2021-07-11 15:13:32 +02:00
Robbert van der Helm
8fc1097f84
Change cursor depending on XdndStatus
2021-07-11 14:32:48 +02:00
Robbert van der Helm
4e67fa9212
Fetch atoms for the remaining two XDND messages
...
We're going to need these anyways.
2021-07-11 14:14:02 +02:00
Robbert van der Helm
7b5810ae57
Listen for XdndStatus
2021-07-11 14:12:35 +02:00
Robbert van der Helm
2671511dc0
Handle ConvertSelection for XDND
2021-07-11 14:05:09 +02:00
Robbert van der Helm
b6fd0405fb
Transform the file list into text/uri-list format
2021-07-11 13:20:36 +02:00
Robbert van der Helm
6f3beca32a
Send XdndPosition messages
2021-07-11 12:34:04 +02:00
Robbert van der Helm
eac9f9433b
Clean up X11 client message functions
...
clang-tidy would warn about all parameters being the same, which is
true, but that's kind of the point here.
2021-07-11 12:15:30 +02:00
Robbert van der Helm
e0ff16cd16
Fix XDND transition state when leaving window
...
Just resetting the last window is of course not enough here. I think
Dolphin/Qt run into the same issue, because their drop seems to stick
when hovering over Emacs (or Emacs is to blame, which could very well be
the case here).
2021-07-11 12:12:02 +02:00
Robbert van der Helm
94125f9eab
Announce XdndEnter and XdndLeave
2021-07-10 23:50:39 +02:00
Robbert van der Helm
7d8a252301
Implement the function for sending XDND messages
2021-07-10 23:18:18 +02:00
Robbert van der Helm
2e153304dd
Find the first XDND aware window under the cursor
2021-07-10 23:08:37 +02:00
Robbert van der Helm
82f7a8f799
Check property type instead of format
...
All of these fields should be zero, but this sounds like the better way
to test this.
2021-07-10 22:24:06 +02:00
Robbert van der Helm
916b1ed6c0
Track the last window we hovered over, if valid
2021-07-10 20:26:45 +02:00
Robbert van der Helm
92daa33adf
Ignore Wine windows in the drag-and-drop handling
...
Wine will be able to handle this better than we can, and we of course
don't want any conflicts here.
2021-07-10 19:57:09 +02:00
Robbert van der Helm
998e222651
Fix definition clashes in unity build
2021-07-10 19:38:24 +02:00
Robbert van der Helm
091ab0f0df
Spawn a thread to fake do our XDND polling
...
We cannot integrate this into our event loop like we planned, because
Wine a) grabs the mouse pointer so we cannot do that, and b) blocks the
GUI thread. So instead we will spawn our own thread and do polling based
XDND. When Wine's tracker window gets destroyed, we know that the left
mouse button has been released.
2021-07-10 19:28:40 +02:00
Robbert van der Helm
42ce69943a
Fix typo in X11 error message
2021-07-10 18:22:54 +02:00
Robbert van der Helm
f044dc4784
Fetch basic atoms for XDND
2021-07-10 17:48:22 +02:00
Robbert van der Helm
ddac793e82
Add a function for fetching X11 atoms by name
2021-07-10 17:22:04 +02:00
Robbert van der Helm
3372f4424e
Create a window for the X11 proxy
2021-07-10 16:43:23 +02:00
Robbert van der Helm
a8b7dc8764
Move the dnd proxy WinEvent callback around
2021-07-10 16:19:52 +02:00
Robbert van der Helm
d908db5476
Add an X11 event handling function to the proxy
2021-07-10 16:19:23 +02:00
Robbert van der Helm
b47a6e034b
Rename init_proxy -> get_handle
2021-07-10 15:16:20 +02:00
Robbert van der Helm
1946693244
Expand on the new mutual recursion changelog entry
2021-07-10 14:40:06 +02:00
Robbert van der Helm
3c94ee7049
Only perform mutual recursion from the GUI thread
...
JUCE incorrectly calls `IComponentHandler::performEdit()` from the audio
thread instead of using the output parameter changes queue, so this
would also cause GUI resizes to be handled from the audio thread if they
come in at the same time as such a parameter change.
2021-07-10 14:30:52 +02:00
Robbert van der Helm
04a8be6cc6
Keep track of which thread the GUI thread is
2021-07-10 14:21:50 +02:00
Robbert van der Helm
df75427f69
Store the dragged files so we can use them in XDND
2021-07-10 13:06:46 +02:00
Robbert van der Helm
c0871e3b5d
Unify drag-and-drop debug messages
2021-07-10 12:44:14 +02:00