xcbOrg/Window: Destroy connections when no longer in use

This commit is contained in:
2025-07-25 01:21:26 -04:00
parent a17c940377
commit 270437fdd4
4 changed files with 61 additions and 12 deletions
+3 -3
View File
@@ -31,12 +31,12 @@ class AttachedWindow
{
public:
AttachedWindow(const smo::device::SenseDeviceSpec& spec);
~AttachedWindow() = default;
~AttachedWindow();
const smo::device::SenseDeviceSpec& getDeviceSpec() const { return deviceSpec; }
const WindowSelector& getWindowSelector() const { return windowSelector; }
const std::string& getActualWindowName() const { return actualWindowName; }
void* getXcbConnection() const { return xcbConnection; }
void* getXcbConnection() const { return xcbConnectionShared.get(); }
std::string stringify() const;
private:
@@ -47,7 +47,7 @@ private:
smo::device::SenseDeviceSpec deviceSpec;
WindowSelector windowSelector;
std::string actualWindowName;
void* xcbConnection; // Raw pointer to XCB connection from libxcbXorg
std::shared_ptr<xcb_xorg::XcbConnection> xcbConnectionShared;
};
} // namespace xcb_window