diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-12-18 15:24:37 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-12-18 15:24:37 +0000 |
| commit | 80a4852266643c622ec68969b39c5abc3c610f30 (patch) | |
| tree | 346d4935130e9c1d2007a67665b72c8c67dd5523 /src | |
| parent | 4c4471c66d89b5293ded757da76ee6f104bcb042 (diff) | |
xwm: fixup targets in selection requests
fixes #8719
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwayland/XWM.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<std::string> 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<xcb_atom_t> atoms; atoms.push_back(HYPRATOMS["TIMESTAMP"]); |
