selection: push data to compositor on acquire for Wayland (select→paste)
This commit is contained in:
parent
784b4c89ce
commit
367b488e47
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue