From eae0eff3aa5c8e3601677e8395fea72be231b554 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jun 2021 00:23:30 +0200 Subject: Clipboard.c: improve some comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 735a9379a..85ef1ae16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -97,6 +97,13 @@ const int nxagentMaxSelections = 2; static XlibAtom *remoteSelectionAtoms = NULL; static Atom *localSelelectionAtoms = NULL; +/* + * The real owner window (inside nxagent) is stored in + * lastSelectionOwner[index].window. + * lastSelectionOwner[index].windowPtr points to the struct that + * contains all information about the owner window. + * lastTimeChanged is always a local time. + */ typedef struct _SelectionOwner { ClientPtr client; /* local client */ @@ -106,9 +113,8 @@ typedef struct _SelectionOwner } SelectionOwner; /* - * This contains the last selection owner in nxagent. The - * lastTimeChanged is always a local time. If .client is NULL the - * owner is outside nxagent. + * This contains the last selection owner for each selection. If + * .client is NULL the owner is outside nxagent or there is no owner. */ static SelectionOwner *lastSelectionOwner = NULL; @@ -717,6 +723,7 @@ static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow) * Attention: does not work properly when both client AND window * are passed as setClientSelectionStage(None) will also clear * the lastClientWindowPtr! + * This is only called from Client.c and Window.c */ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) { -- cgit v1.2.3