Commit Graph

29 Commits

Author SHA1 Message Date
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 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 f044dc4784 Fetch basic atoms for XDND 2021-07-10 17:48:22 +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 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
Robbert van der Helm bc9d4d02a2 Fix copy and move semantics for DnD proxy handle 2021-07-10 02:17:10 +02:00
Robbert van der Helm dbb1b09256 Add proper copy and move semantics to proxy handle 2021-07-10 00:49:11 +02:00
Robbert van der Helm 2ba2cf1ab7 Free the drag-and-drop proxy after closing editors
Apparently X11 connections are a scarce resource, so it seems like a
good idea to not hang on to them for too long. Now this is sort of a
hybrid between COM-style memory management and a singleton.
2021-07-10 00:15:38 +02:00
Robbert van der Helm b1e3488a24 Add an X11 connection to the drag-and-drop proxy 2021-07-10 00:09:29 +02:00
Robbert van der Helm 41160adc33 Fix the drag-and-drop debugging message
Because why not?
2021-07-09 21:37:29 +02:00
Robbert van der Helm dd14a90f9a Only handle drag-and-drop from this process
When called from another process the data pointer will of course be
invalid, so every process must handle their own drag-and-drop.
2021-07-09 21:32:56 +02:00
Robbert van der Helm f33c02f4f7 Add a proof of concept drag-and-drop snooper
This doesn't do anything useful yet, but it will print the names of
files that are being dragged and dropped on the Wine server (using the
OLE API) while the plugin is open.
2021-07-09 20:53:15 +02:00
Robbert van der Helm fc61658ada Add the start for a Wine->X11 DnD wrapper 2021-07-09 18:48:11 +02:00