aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-12-16 22:47:23 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 23:36:02 +0100
commit40c243fd203eabea5f97a1f797663173f478213a (patch)
treed34257fade44c4409e5f6ed17f06505d5cdc6861 /nx-X11/programs/Xserver/hw
parentee5cf733fed11c68db5d41f821e4e3b8f5296770 (diff)
downloadnx-libs-40c243fd203eabea5f97a1f797663173f478213a.tar.gz
nx-libs-40c243fd203eabea5f97a1f797663173f478213a.tar.bz2
nx-libs-40c243fd203eabea5f97a1f797663173f478213a.zip
Clipboard.c: add clientCLIPBOARD variable
the MakeAtom call previously used is as good as using a variable but with the variable it is a) easier to read/understand and b) consistent with the other client* variables.
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 1aafeceaa..db5bfd65f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -143,6 +143,7 @@ static Atom clientTIMESTAMP;
static Atom clientTEXT;
static Atom clientCOMPOUND_TEXT;
static Atom clientUTF8_STRING;
+static Atom clientCLIPBOARD;
static char szAgentTARGETS[] = "TARGETS";
static char szAgentTEXT[] = "TEXT";
@@ -150,6 +151,7 @@ static char szAgentTIMESTAMP[] = "TIMESTAMP";
static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT";
static char szAgentUTF8_STRING[] = "UTF8_STRING";
static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT";
+static char szAgentCLIPBOARD[] = "CLIPBOARD";
/* number of milliseconds to wait for a conversion from the real X server. */
#define CONVERSION_TIMEOUT 5000
@@ -377,6 +379,7 @@ void nxagentPrintClipboardStat(char *header)
fprintf(stderr, " clientTEXT [% 4d][%s]\n", clientTEXT, NameForAtom(clientTEXT));
fprintf(stderr, " clientCOMPOUND_TEXT [% 4d][%s]\n", clientCOMPOUND_TEXT, NameForAtom(clientCOMPOUND_TEXT));
fprintf(stderr, " clientUTF8_STRING [% 4d][%s]\n", clientUTF8_STRING, NameForAtom(clientUTF8_STRING));
+ fprintf(stderr, " clientCLIPBOARD [% 4d][%s]\n", clientCLIPBOARD, NameForAtom(clientCLIPBOARD));
fprintf(stderr, " clientCutProperty [% 4d][%s]\n", clientCutProperty, NameForAtom(clientCutProperty));
fprintf(stderr, " nxagentLastRequestedSelection [% 4d][%s]\n", nxagentLastRequestedSelection, NameForAtom(nxagentLastRequestedSelection));
@@ -1564,7 +1567,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
if ((pCurSel->pWin != NULL) &&
(nxagentOption(Clipboard) != ClipboardNone) && /* FIXME: shouldn't we also check for != ClipboardClient? */
((pCurSel->selection == XA_PRIMARY) ||
- (pCurSel->selection == MakeAtom("CLIPBOARD", 9, 0))))
+ (pCurSel->selection == clientCLIPBOARD)))
{
#ifdef DEBUG
fprintf(stderr, "%s: calling nxagentSetSelectionOwner\n", __func__);
@@ -1912,7 +1915,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if ((GetTimeInMillis() - lastClientReqTime) >= CONVERSION_TIMEOUT)
lastClientReqTime = GetTimeInMillis();
- if (selection == MakeAtom("CLIPBOARD", 9, 0))
+ if (selection == clientCLIPBOARD)
{
selection = lastSelectionOwner[nxagentClipboardSelection].selection;
}
@@ -2048,7 +2051,7 @@ int nxagentSendNotify(xEvent *event)
* X servers (defined in Xatom.h).
*/
- if (event->u.selectionNotify.selection == MakeAtom("CLIPBOARD", 9, 0))
+ if (event->u.selectionNotify.selection == clientCLIPBOARD)
{
eventSelection.selection = lastSelectionOwner[nxagentClipboardSelection].selection;
}
@@ -2274,6 +2277,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True);
clientUTF8_STRING = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True);
clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True);
+ clientCLIPBOARD = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True);
clientCutProperty = MakeAtom(szAgentNX_CUT_BUFFER_CLIENT,
strlen(szAgentNX_CUT_BUFFER_CLIENT), True);