summaryrefslogtreecommitdiff
path: root/src/xwayland/XDataSource.cpp
diff options
context:
space:
mode:
authorJasson <Jasson.cordones@hotmail.com>2025-06-19 13:44:38 -0400
committerGitHub <noreply@github.com>2025-06-19 19:44:38 +0200
commitb49d0ca20e4378db1e9abeb661d72f4c8c070db9 (patch)
tree22df2f551b570daf4495ae8fa1fc0e1f5fdd78ce /src/xwayland/XDataSource.cpp
parent86b5e3bfbc99237bb28a253fbef49b9c1b7bc3a3 (diff)
xwayland: Fix crash when copying from wayland to xwayland (#10786)
Diffstat (limited to 'src/xwayland/XDataSource.cpp')
-rw-r--r--src/xwayland/XDataSource.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xwayland/XDataSource.cpp b/src/xwayland/XDataSource.cpp
index ec06c9bc..6b4637e5 100644
--- a/src/xwayland/XDataSource.cpp
+++ b/src/xwayland/XDataSource.cpp
@@ -8,11 +8,11 @@
using namespace Hyprutils::OS;
CXDataSource::CXDataSource(SXSelection& sel_) : m_selection(sel_) {
- xcb_get_property_cookie_t cookie = xcb_get_property(g_pXWayland->m_wm->m_connection,
+ xcb_get_property_cookie_t cookie = xcb_get_property(g_pXWayland->m_wm->getConnection(),
1, // delete
m_selection.window, HYPRATOMS["_WL_SELECTION"], XCB_GET_PROPERTY_TYPE_ANY, 0, 4096);
- xcb_get_property_reply_t* reply = xcb_get_property_reply(g_pXWayland->m_wm->m_connection, cookie, nullptr);
+ xcb_get_property_reply_t* reply = xcb_get_property_reply(g_pXWayland->m_wm->getConnection(), cookie, nullptr);
if (!reply)
return;
@@ -72,9 +72,9 @@ void CXDataSource::send(const std::string& mime, CFileDescriptor fd) {
Debug::log(LOG, "[XDataSource] send with mime {} to fd {}", mime, fd.get());
auto transfer = makeUnique<SXTransfer>(m_selection);
- transfer->incomingWindow = xcb_generate_id(g_pXWayland->m_wm->m_connection);
+ transfer->incomingWindow = xcb_generate_id(g_pXWayland->m_wm->getConnection());
const uint32_t MASK = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE;
- xcb_create_window(g_pXWayland->m_wm->m_connection, XCB_COPY_FROM_PARENT, transfer->incomingWindow, g_pXWayland->m_wm->m_screen->root, 0, 0, 10, 10, 0,
+ xcb_create_window(g_pXWayland->m_wm->getConnection(), XCB_COPY_FROM_PARENT, transfer->incomingWindow, g_pXWayland->m_wm->m_screen->root, 0, 0, 10, 10, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT, g_pXWayland->m_wm->m_screen->root_visual, XCB_CW_EVENT_MASK, &MASK);
xcb_atom_t selection_atom = HYPRATOMS["CLIPBOARD"];
@@ -83,9 +83,9 @@ void CXDataSource::send(const std::string& mime, CFileDescriptor fd) {
else if (&m_selection == &g_pXWayland->m_wm->m_dndSelection)
selection_atom = HYPRATOMS["XdndSelection"];
- xcb_convert_selection(g_pXWayland->m_wm->m_connection, transfer->incomingWindow, selection_atom, mimeAtom, HYPRATOMS["_WL_SELECTION"], XCB_TIME_CURRENT_TIME);
+ xcb_convert_selection(g_pXWayland->m_wm->getConnection(), transfer->incomingWindow, selection_atom, mimeAtom, HYPRATOMS["_WL_SELECTION"], XCB_TIME_CURRENT_TIME);
- xcb_flush(g_pXWayland->m_wm->m_connection);
+ xcb_flush(g_pXWayland->m_wm->getConnection());
//TODO: make CFileDescriptor setflags take SETFL aswell
fcntl(fd.get(), F_SETFL, O_WRONLY | O_NONBLOCK);