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.
This commit is contained in:
Robbert van der Helm
2021-07-10 00:07:21 +02:00
parent b1e3488a24
commit 2ba2cf1ab7
4 changed files with 78 additions and 9 deletions
+10
View File
@@ -31,6 +31,7 @@
#include "../common/configuration.h"
#include "utils.h"
#include "xdnd-proxy.h"
/**
* The maximum number of Win32 messages to handle per message loop. This is
@@ -223,8 +224,17 @@ class Editor {
*/
void do_xembed() const;
/**
* Every editor window gets its own X11 connection.
*/
std::shared_ptr<xcb_connection_t> x11_connection;
/**
* A handle for our Wine->X11 drag-and-drop proxy. We only have one of these
* per process, and it gets freed again when the last handle gets dropped.
*/
WineXdndProxy::Handle dnd_proxy_handle;
/**
* The Wine window's client area, or the maximum size of that window. This
* will be set to a size that's large enough to be able to enter full screen