selection: push data to compositor on acquire for Wayland (select→paste)

This commit is contained in:
Ollie 2026-05-28 21:04:24 +02:00
parent 784b4c89ce
commit 367b488e47
1 changed files with 20 additions and 0 deletions

View File

@ -353,6 +353,26 @@ Bool WMCreateSelectionHandler(WMView * view, WMNativeAtom selection, Time timest
WMAddToArray(selHandlers, handler);
/* On Wayland (no X11 SelectionRequest events), immediately push
* the selection data via the clipboard store path so external
* clients can paste it. The data is fetched from the view's
* convertSelection callback. */
if (vb->selection_fetch && handler->procs.convertSelection) {
WMNativeAtom textAtom = XA_STRING;
WMNativeAtom type;
WMData *data = handler->procs.convertSelection(handler->view,
selection, textAtom, handler->data, &type);
if (data) {
if (view->screen->viewBackend->clipboard_store) {
view->screen->viewBackend->clipboard_store(
view->screen->viewBackendCtx,
WMDataBytes(data),
WMGetDataLength(data));
}
WMReleaseData(data);
}
}
return True;
}