summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-06-16 21:34:17 +0200
committerVaxry <vaxry@vaxry.net>2024-06-16 21:34:17 +0200
commitb15be9c77de593581007de53b2bbca97d121900a (patch)
tree7572b458b7b70c37e13d334449e5c74eaf245444 /src
parentd5ef10abf429355246abcda65fe4c15d886fad7c (diff)
xwayland: do not set a new data source if it has no MIMEs
ref #6247
Diffstat (limited to 'src')
-rw-r--r--src/xwayland/XWM.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp
index 719adcb9..7b57de0f 100644
--- a/src/xwayland/XWM.cpp
+++ b/src/xwayland/XWM.cpp
@@ -1034,16 +1034,16 @@ void CXWM::initSelection() {
}
void CXWM::setClipboardToWayland(SXSelection& sel) {
- sel.dataSource = makeShared<CXDataSource>(sel);
- if (sel.dataSource->mimes().empty()) {
+ auto source = makeShared<CXDataSource>(sel);
+ if (source->mimes().empty()) {
Debug::log(ERR, "[xwm] can't set clipboard: no MIMEs");
- sel.dataSource.reset();
+ return;
}
- if (sel.dataSource) {
- Debug::log(LOG, "[xwm] X clipboard at {:x} takes clipboard", (uintptr_t)sel.dataSource.get());
- g_pSeatManager->setCurrentSelection(sel.dataSource);
- }
+ sel.dataSource = source;
+
+ Debug::log(LOG, "[xwm] X clipboard at {:x} takes clipboard", (uintptr_t)sel.dataSource.get());
+ g_pSeatManager->setCurrentSelection(sel.dataSource);
}
void CXWM::getTransferData(SXSelection& sel) {