diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-12-28 21:02:14 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-05 22:52:53 +0100 |
commit | 427b7b9777727df4115e3e9e6e63d5176fb0b495 (patch) | |
tree | 1d319a61f55dd6132c17b5e7cb45b4585c3b6160 /nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | |
parent | a261b72435d7d30dbe36529a51fc53f6ade34dff (diff) | |
download | nx-libs-427b7b9777727df4115e3e9e6e63d5176fb0b495.tar.gz nx-libs-427b7b9777727df4115e3e9e6e63d5176fb0b495.tar.bz2 nx-libs-427b7b9777727df4115e3e9e6e63d5176fb0b495.zip |
nxagent: Use XlibAtom data type where appropriate
XlibAtom should be used wherever remote atoms are handled. This is
important as Xlib data types and server data types of the same name do
not always have identical sizes.
See also https://lists.freedesktop.org/archives/xorg-devel/2015-August/047245.html
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Clipboard.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 6ec30a3fb..b42396731 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -30,9 +30,9 @@ #include "windowstr.h" #include "scrnintstr.h" +#include "Agent.h" #include "Windows.h" #include "Atoms.h" -#include "Agent.h" #include "Args.h" #include "Trap.h" #include "Rootless.h" @@ -72,7 +72,7 @@ static int agentClipboardStatus; static int clientAccum; #endif -Atom serverCutProperty; +XlibAtom serverCutProperty; Atom clientCutProperty; static Window serverWindow; @@ -82,7 +82,7 @@ const int nxagentMaxSelections = 2; typedef struct _SelectionOwner { - Atom selection; /* _external_ Atom */ + XlibAtom selection; /* _external_ Atom */ ClientPtr client; /* internal client */ Window window; /* internal window id */ WindowPtr windowPtr; /* internal window struct */ @@ -96,7 +96,7 @@ typedef struct _SelectionOwner * external atom of the selection */ static SelectionOwner *lastSelectionOwner; -static Atom nxagentLastRequestedSelection; +static XlibAtom nxagentLastRequestedSelection; /* * Needed to handle the notify selection event to @@ -125,16 +125,16 @@ static unsigned long lastClientPropertySize; static ClientSelectionStage lastClientStage; -static Window lastServerRequestor; -static Atom lastServerProperty; -static Atom lastServerTarget; -static Time lastServerTime; +static Window lastServerRequestor; +static XlibAtom lastServerProperty; +static XlibAtom lastServerTarget; +static Time lastServerTime; -static Atom serverTARGETS; -static Atom serverTIMESTAMP; -static Atom serverTEXT; -static Atom serverUTF8_STRING; -static Atom serverClientCutProperty; +static XlibAtom serverTARGETS; +static XlibAtom serverTIMESTAMP; +static XlibAtom serverTEXT; +static XlibAtom serverUTF8_STRING; +static XlibAtom serverClientCutProperty; static Atom clientTARGETS; static Atom clientTEXT; static Atom clientCOMPOUND_TEXT; @@ -209,7 +209,7 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; extern Display *nxagentDisplay; -Bool nxagentValidServerTargets(Atom target); +Bool nxagentValidServerTargets(XlibAtom target); static void endTransfer(Bool success); #define SELECTION_SUCCESS True #define SELECTION_FAULT False @@ -448,7 +448,7 @@ int SendSelectionNotifyEventToClient(ClientPtr client, * server, like .e.g XA_STRING or UTF8_STRING. Other, non content type * targets like "TARGETS" or "TIMESTAMP" will return false. */ -Bool nxagentValidServerTargets(Atom target) +Bool nxagentValidServerTargets(XlibAtom target) { if (target == XA_STRING) { @@ -553,7 +553,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) nxagentPrintClipboardStat("after nxagentClearClipboard"); } -int nxagentFindLastSelectionOwnerIndex(Atom sel) +int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { int i = 0; while ((i < nxagentMaxSelections) && @@ -1992,7 +1992,6 @@ int nxagentSendNotify(xEvent *event) WindowPtr nxagentGetClipboardWindow(Atom property) { int i = nxagentFindLastSelectionOwnerIndex(nxagentLastRequestedSelection); - if ((i < nxagentMaxSelections) && (property == clientCutProperty) && (lastSelectionOwner[i].windowPtr != NULL)) { |