Commit 0fb6af25 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXdispatch.c: mark NX changes

parent c61ac23f
...@@ -629,12 +629,17 @@ ProcQueryTree(register ClientPtr client) ...@@ -629,12 +629,17 @@ ProcQueryTree(register ClientPtr client)
reply.parent = (Window)None; reply.parent = (Window)None;
pHead = RealChildHead(pWin); pHead = RealChildHead(pWin);
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
#ifdef NXAGENT_SERVER
{ {
if (!IsViewportFrame(pChild)) if (!IsViewportFrame(pChild))
{ {
numChildren++; numChildren++;
} }
} }
#else
numChildren++;
#endif
if (numChildren) if (numChildren)
{ {
int curChild = 0; int curChild = 0;
...@@ -643,12 +648,16 @@ ProcQueryTree(register ClientPtr client) ...@@ -643,12 +648,16 @@ ProcQueryTree(register ClientPtr client)
if (!childIDs) if (!childIDs)
return BadAlloc; return BadAlloc;
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
{ #ifdef NXAGENT_SERVER
if (!IsViewportFrame(pChild)) {
{ if (!IsViewportFrame(pChild))
childIDs[curChild++] = pChild->drawable.id; {
} childIDs[curChild++] = pChild->drawable.id;
}
} }
#else
childIDs[curChild++] = pChild->drawable.id;
#endif
} }
reply.nChildren = numChildren; reply.nChildren = numChildren;
...@@ -707,8 +716,12 @@ ProcConvertSelection(register ClientPtr client) ...@@ -707,8 +716,12 @@ ProcConvertSelection(register ClientPtr client)
i = 0; i = 0;
while ((i < NumCurrentSelections) && while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != stuff->selection) i++; CurrentSelections[i].selection != stuff->selection) i++;
if ((i < NumCurrentSelections) && if ((i < NumCurrentSelections) &&
#ifdef NXAGENT_SERVER
(CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient) (CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient)
#else
(CurrentSelections[i].window != None))
#endif
#ifdef XCSECURITY #ifdef XCSECURITY
&& (!client->CheckAccess || && (!client->CheckAccess ||
(* client->CheckAccess)(client, CurrentSelections[i].window, (* client->CheckAccess)(client, CurrentSelections[i].window,
...@@ -716,7 +729,6 @@ ProcConvertSelection(register ClientPtr client) ...@@ -716,7 +729,6 @@ ProcConvertSelection(register ClientPtr client)
CurrentSelections[i].pWin)) CurrentSelections[i].pWin))
#endif #endif
) )
{ {
memset(&event, 0, sizeof(xEvent)); memset(&event, 0, sizeof(xEvent));
event.u.u.type = SelectionRequest; event.u.u.type = SelectionRequest;
...@@ -755,13 +767,14 @@ int ...@@ -755,13 +767,14 @@ int
ProcOpenFont(register ClientPtr client) ProcOpenFont(register ClientPtr client)
{ {
int err; int err;
char fontReq[256];
REQUEST(xOpenFontReq); REQUEST(xOpenFontReq);
REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes);
client->errorValue = stuff->fid; client->errorValue = stuff->fid;
LEGAL_NEW_RESOURCE(stuff->fid, client); LEGAL_NEW_RESOURCE(stuff->fid, client);
#ifdef NXAGENT_SERVER
char fontReq[256];
memcpy(fontReq,(char *)&stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); memcpy(fontReq,(char *)&stuff[1],(stuff->nbytes<256)?stuff->nbytes:255);
fontReq[stuff->nbytes]=0; fontReq[stuff->nbytes]=0;
if (strchr(fontReq,'*') || strchr(fontReq,'?')) if (strchr(fontReq,'*') || strchr(fontReq,'?'))
...@@ -774,6 +787,7 @@ ProcOpenFont(register ClientPtr client) ...@@ -774,6 +787,7 @@ ProcOpenFont(register ClientPtr client)
stuff->nbytes, (char *)&stuff[1]); stuff->nbytes, (char *)&stuff[1]);
} }
else else
#endif
err = OpenFont(client, stuff->fid, (Mask) 0, err = OpenFont(client, stuff->fid, (Mask) 0,
stuff->nbytes, (char *)&stuff[1]); stuff->nbytes, (char *)&stuff[1]);
if (err == Success) if (err == Success)
...@@ -844,11 +858,12 @@ ProcCloseFont(register ClientPtr client) ...@@ -844,11 +858,12 @@ ProcCloseFont(register ClientPtr client)
int int
ProcListFonts(register ClientPtr client) ProcListFonts(register ClientPtr client)
{ {
char tmp[256];
REQUEST(xListFontsReq); REQUEST(xListFontsReq);
REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes);
#ifdef NXAGENT_SERVER
char tmp[256];
memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255);
tmp[stuff->nbytes]=0; tmp[stuff->nbytes]=0;
...@@ -856,6 +871,8 @@ ProcListFonts(register ClientPtr client) ...@@ -856,6 +871,8 @@ ProcListFonts(register ClientPtr client)
fprintf(stderr, "Dispatch: ListFont request with pattern %s max_names=%d\n",tmp,stuff->maxNames); fprintf(stderr, "Dispatch: ListFont request with pattern %s max_names=%d\n",tmp,stuff->maxNames);
#endif #endif
nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames : stuff->maxNames); nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames : stuff->maxNames);
#endif
return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes,
stuff->maxNames); stuff->maxNames);
} }
...@@ -863,23 +880,24 @@ ProcListFonts(register ClientPtr client) ...@@ -863,23 +880,24 @@ ProcListFonts(register ClientPtr client)
int int
ProcListFontsWithInfo(register ClientPtr client) ProcListFontsWithInfo(register ClientPtr client)
{ {
char tmp[256];
REQUEST(xListFontsWithInfoReq); REQUEST(xListFontsWithInfoReq);
REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes);
#ifdef NXAGENT_SERVER
char tmp[256];
memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255);
tmp[stuff->nbytes]=0; tmp[stuff->nbytes]=0;
#ifdef NXAGENT_FONTMATCH_DEBUG #ifdef NXAGENT_FONTMATCH_DEBUG
fprintf(stderr, "Dispatch: ListFont with info request with pattern %s max_names=%d\n",tmp,stuff->maxNames); fprintf(stderr, "Dispatch: ListFont with info request with pattern %s max_names=%d\n",tmp,stuff->maxNames);
#endif #endif
nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames :stuff->maxNames); nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames :stuff->maxNames);
#endif
return StartListFontsWithInfo(client, stuff->nbytes, return StartListFontsWithInfo(client, stuff->nbytes,
(unsigned char *) &stuff[1], stuff->maxNames); (unsigned char *) &stuff[1], stuff->maxNames);
} }
int int
ProcFreePixmap(register ClientPtr client) ProcFreePixmap(register ClientPtr client)
{ {
...@@ -971,6 +989,7 @@ ProcSetScreenSaver (register ClientPtr client) ...@@ -971,6 +989,7 @@ ProcSetScreenSaver (register ClientPtr client)
return BadValue; return BadValue;
} }
#ifdef NXAGENT_SERVER
/* /*
* The NX agent uses the screen saver procedure * The NX agent uses the screen saver procedure
* to monitor the user activities and launch its * to monitor the user activities and launch its
...@@ -985,6 +1004,7 @@ ProcSetScreenSaver (register ClientPtr client) ...@@ -985,6 +1004,7 @@ ProcSetScreenSaver (register ClientPtr client)
if (nxagentOption(Timeout) == 0) if (nxagentOption(Timeout) == 0)
{ {
#endif
if (blankingOption == DefaultBlanking) if (blankingOption == DefaultBlanking)
{ {
ScreenSaverBlanking = defaultScreenSaverBlanking; ScreenSaverBlanking = defaultScreenSaverBlanking;
...@@ -1022,7 +1042,9 @@ ProcSetScreenSaver (register ClientPtr client) ...@@ -1022,7 +1042,9 @@ ProcSetScreenSaver (register ClientPtr client)
} }
SetScreenSaverTimer(); SetScreenSaverTimer();
#ifdef NXAGENT_SERVER
} }
#ifdef TEST #ifdef TEST
else else
...@@ -1032,7 +1054,7 @@ ProcSetScreenSaver (register ClientPtr client) ...@@ -1032,7 +1054,7 @@ ProcSetScreenSaver (register ClientPtr client)
} }
#endif #endif
#endif
return (client->noClientException); return (client->noClientException);
} }
...@@ -1050,6 +1072,7 @@ int ProcForceScreenSaver(register ClientPtr client) ...@@ -1050,6 +1072,7 @@ int ProcForceScreenSaver(register ClientPtr client)
return BadValue; return BadValue;
} }
#ifdef NXAGENT_SERVER
/* /*
* The NX agent uses the screen saver procedure * The NX agent uses the screen saver procedure
* to monitor the user activities and launch its * to monitor the user activities and launch its
...@@ -1060,7 +1083,9 @@ int ProcForceScreenSaver(register ClientPtr client) ...@@ -1060,7 +1083,9 @@ int ProcForceScreenSaver(register ClientPtr client)
if (nxagentOption(Timeout) == 0) if (nxagentOption(Timeout) == 0)
{ {
#endif
SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode); SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode);
#ifdef NXAGENT_SERVER
} }
#ifdef TEST #ifdef TEST
...@@ -1072,6 +1097,7 @@ int ProcForceScreenSaver(register ClientPtr client) ...@@ -1072,6 +1097,7 @@ int ProcForceScreenSaver(register ClientPtr client)
} }
#endif #endif
#endif
return client->noClientException; return client->noClientException;
} }
...@@ -1087,6 +1113,7 @@ int ProcForceScreenSaver(register ClientPtr client) ...@@ -1087,6 +1113,7 @@ int ProcForceScreenSaver(register ClientPtr client)
void void
CloseDownClient(register ClientPtr client) CloseDownClient(register ClientPtr client)
{ {
#ifdef NXAGENT_SERVER
/* /*
* There must be a better way to hook a * There must be a better way to hook a
* call-back function to be called any * call-back function to be called any
...@@ -1108,6 +1135,7 @@ CloseDownClient(register ClientPtr client) ...@@ -1108,6 +1135,7 @@ CloseDownClient(register ClientPtr client)
*/ */
nxagentCheckIfShadowAgent(client); nxagentCheckIfShadowAgent(client);
#endif
xorg_CloseDownClient(client); xorg_CloseDownClient(client);
} }
...@@ -1117,6 +1145,7 @@ InitClientPrivates(ClientPtr client) ...@@ -1117,6 +1145,7 @@ InitClientPrivates(ClientPtr client)
{ {
int ret = xorg_InitClientPrivates(client); int ret = xorg_InitClientPrivates(client);
#ifdef NXAGENT_SERVER
if (ret == 1) if (ret == 1)
{ {
...@@ -1126,6 +1155,7 @@ InitClientPrivates(ClientPtr client) ...@@ -1126,6 +1155,7 @@ InitClientPrivates(ClientPtr client)
nxagentInitClientPrivates(client); nxagentInitClientPrivates(client);
} }
#endif
return ret; return ret;
} }
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