From 80a4852266643c622ec68969b39c5abc3c610f30 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 18 Dec 2024 15:24:37 +0000 Subject: xwm: fixup targets in selection requests fixes #8719 --- src/xwayland/XWM.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp index ec563375..44485381 100644 --- a/src/xwayland/XWM.cpp +++ b/src/xwayland/XWM.cpp @@ -633,7 +633,14 @@ void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) { if (e->target == HYPRATOMS["TARGETS"]) { // send mime types - auto mimes = g_pSeatManager->selection.currentSelection->mimes(); + std::vector mimes; + if (sel == &clipboard && g_pSeatManager->selection.currentSelection) + mimes = g_pSeatManager->selection.currentSelection->mimes(); + else if (sel == &dndSelection && !dndDataOffers.empty() && dndDataOffers.at(0)->source) + mimes = dndDataOffers.at(0)->source->mimes(); + + if (mimes.empty()) + Debug::log(WARN, "[xwm] WARNING: No mimes in TARGETS?"); std::vector atoms; atoms.push_back(HYPRATOMS["TIMESTAMP"]); -- cgit v1.2.3