Commit 084d9cb5 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXdispatch.c: replace hardcoded values by variables from Clipboard.c

parent 7a2836f8
...@@ -74,9 +74,9 @@ Atom serverCutProperty; ...@@ -74,9 +74,9 @@ Atom serverCutProperty;
Atom clientCutProperty; Atom clientCutProperty;
static Window serverWindow; static Window serverWindow;
static const int nxagentPrimarySelection = 0; const int nxagentPrimarySelection = 0;
static const int nxagentClipboardSelection = 1; const int nxagentClipboardSelection = 1;
static const int nxagentMaxSelections = 2; const int nxagentMaxSelections = 2;
typedef struct _SelectionOwner typedef struct _SelectionOwner
{ {
......
...@@ -194,6 +194,11 @@ extern int nxagentMaxAllowedResets; ...@@ -194,6 +194,11 @@ extern int nxagentMaxAllowedResets;
extern int nxagentFindClientResource(int, RESTYPE, void *); extern int nxagentFindClientResource(int, RESTYPE, void *);
#ifdef NXAGENT_CLIPBOARD
extern int nxagentPrimarySelection;
extern int nxagentClipboardSelection;
extern int nxagentMaxSelections;
#endif
void void
InitSelections() InitSelections()
...@@ -206,23 +211,23 @@ InitSelections() ...@@ -206,23 +211,23 @@ InitSelections()
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
{ {
Selection *newsels; Selection *newsels;
newsels = (Selection *)malloc(2 * sizeof(Selection)); newsels = (Selection *)malloc(nxagentMaxSelections * sizeof(Selection));
if (!newsels) if (!newsels)
return; return;
NumCurrentSelections += 2; NumCurrentSelections += nxagentMaxSelections;
CurrentSelections = newsels; CurrentSelections = newsels;
CurrentSelections[0].selection = XA_PRIMARY; CurrentSelections[nxagentPrimarySelection].selection = XA_PRIMARY;
CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); CurrentSelections[nxagentPrimarySelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[0].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[0].pWin = NULL; CurrentSelections[nxagentPrimarySelection].pWin = NULL;
CurrentSelections[0].client = NullClient; CurrentSelections[nxagentPrimarySelection].client = NullClient;
CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); CurrentSelections[nxagentClipboardSelection].selection = MakeAtom("CLIPBOARD", 9, 1);
CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); CurrentSelections[nxagentClipboardSelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[1].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[1].pWin = NULL; CurrentSelections[nxagentClipboardSelection].pWin = NULL;
CurrentSelections[1].client = NullClient; CurrentSelections[nxagentClipboardSelection].client = NullClient;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment