mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
clipboard-x11: use separate properties to receive primary and clipboard
Fixes one of the property not being set when a client sets primary and clipboard at the same time.
This commit is contained in:
@@ -186,11 +186,12 @@ static bool clipboard_x11_dispatch_events(struct clipboard_x11_priv *x11, int64_
|
||||
MP_TRACE(x11, "XEvent: %d\n", event.type);
|
||||
if (event.type == x11->XFixesSelectionNotifyEvent) {
|
||||
XFixesSelectionNotifyEvent *ev = (XFixesSelectionNotifyEvent *)&event;
|
||||
if (ev->owner != x11->window &&
|
||||
(ev->selection == XA(x11, CLIPBOARD) || ev->selection == XA_PRIMARY))
|
||||
{
|
||||
if (ev->owner != x11->window && ev->selection == XA(x11, CLIPBOARD)) {
|
||||
XConvertSelection(x11->display, ev->selection, XA(x11, UTF8_STRING),
|
||||
XA(x11, MPV_SELECTION), x11->window, CurrentTime);
|
||||
XA(x11, MPV_CLIPBOARD), x11->window, CurrentTime);
|
||||
} else if (ev->owner != x11->window && ev->selection == XA_PRIMARY) {
|
||||
XConvertSelection(x11->display, ev->selection, XA(x11, UTF8_STRING),
|
||||
XA(x11, MPV_PRIMARY), x11->window, CurrentTime);
|
||||
}
|
||||
} else if (event.type == SelectionRequest) {
|
||||
clipboard_x11_handle_selection_request(x11, &event);
|
||||
|
||||
Reference in New Issue
Block a user