diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-06-24 21:39:45 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-09-29 17:10:05 +0200 |
commit | 084d9cb546c7d6aa045522af86e5829462717096 (patch) | |
tree | 96a7de88c2249027f3a7105c64a58093351ca031 /nx-X11/programs/Xserver | |
parent | 7a2836f8db9941aaefd88b595f43589ff513b53e (diff) | |
download | nx-libs-084d9cb546c7d6aa045522af86e5829462717096.tar.gz nx-libs-084d9cb546c7d6aa045522af86e5829462717096.tar.bz2 nx-libs-084d9cb546c7d6aa045522af86e5829462717096.zip |
NXdispatch.c: replace hardcoded values by variables from Clipboard.c
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 31 |
2 files changed, 21 insertions, 16 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 024d685ba..a98d07413 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -74,9 +74,9 @@ Atom serverCutProperty; Atom clientCutProperty; static Window serverWindow; -static const int nxagentPrimarySelection = 0; -static const int nxagentClipboardSelection = 1; -static const int nxagentMaxSelections = 2; +const int nxagentPrimarySelection = 0; +const int nxagentClipboardSelection = 1; +const int nxagentMaxSelections = 2; typedef struct _SelectionOwner { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 10616834e..f68623740 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -194,6 +194,11 @@ extern int nxagentMaxAllowedResets; extern int nxagentFindClientResource(int, RESTYPE, void *); +#ifdef NXAGENT_CLIPBOARD +extern int nxagentPrimarySelection; +extern int nxagentClipboardSelection; +extern int nxagentMaxSelections; +#endif void InitSelections() @@ -206,23 +211,23 @@ InitSelections() #ifdef NXAGENT_CLIPBOARD { Selection *newsels; - newsels = (Selection *)malloc(2 * sizeof(Selection)); + newsels = (Selection *)malloc(nxagentMaxSelections * sizeof(Selection)); if (!newsels) return; - NumCurrentSelections += 2; + NumCurrentSelections += nxagentMaxSelections; CurrentSelections = newsels; - CurrentSelections[0].selection = XA_PRIMARY; - CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[0].window = screenInfo.screens[0]->root->drawable.id; - CurrentSelections[0].pWin = NULL; - CurrentSelections[0].client = NullClient; - - CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); - CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[1].window = screenInfo.screens[0]->root->drawable.id; - CurrentSelections[1].pWin = NULL; - CurrentSelections[1].client = NullClient; + CurrentSelections[nxagentPrimarySelection].selection = XA_PRIMARY; + CurrentSelections[nxagentPrimarySelection].lastTimeChanged = ClientTimeToServerTime(0); + CurrentSelections[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id; + CurrentSelections[nxagentPrimarySelection].pWin = NULL; + CurrentSelections[nxagentPrimarySelection].client = NullClient; + + CurrentSelections[nxagentClipboardSelection].selection = MakeAtom("CLIPBOARD", 9, 1); + CurrentSelections[nxagentClipboardSelection].lastTimeChanged = ClientTimeToServerTime(0); + CurrentSelections[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id; + CurrentSelections[nxagentClipboardSelection].pWin = NULL; + CurrentSelections[nxagentClipboardSelection].client = NullClient; } #endif |