From 3fd7e5f93fe0cc3198c5cc2fb5da9635b849c5be Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 10 Jun 2019 14:18:06 +0200 Subject: Add nxagentExternalClipboardEventTrap --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 7ec97dada..4bddbba3a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2968,7 +2968,19 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) info.selection = &CurrentSelections[i]; info.kind = xfixesEvent->xfixesselection.subtype; + + /* + * The trap indicates that we are triggered by a clipboard event + * originating from the real X server. In that case we do not + * want to propagate back changes to the real X server, because + * it already knows about them and we would end up in an + * infinite loop of events. If there was a better way to + * identify that situation during Callback processing we could + * get rid of the Trap... + */ + nxagentExternalClipboardEventTrap = 1; CallCallbacks(&SelectionCallback, &info); + nxagentExternalClipboardEventTrap = 0; } } return 1; -- cgit v1.2.3