Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw/nxagent: Drop support for MCOPGLOBALS atom needed by KDE 3's ancie… #408

Open
wants to merge 1 commit into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion nx-X11/programs/Xserver/hw/nxagent/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ DEFINES = \
-DNXAGENT_WAKEUP=1000 \
-DNXAGENT_ONSTART \
-DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \
-DNXAGENT_RANDR_MODE_PREFIX \
-UNX_DEBUG_INPUT \
-DRANDR_10_INTERFACE=1 \
Expand Down
12 changes: 0 additions & 12 deletions nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,6 @@ ProcChangeProperty(ClientPtr client)
}
#endif

#ifdef NXAGENT_ARTSD
{
/* Do not process MCOPGLOBALS property changes,
they are already set reflecting the server side settings.
Just return success.
*/
extern Atom mcop_local_atom;
if (stuff->property == mcop_local_atom)
return client->noClientException;
}
#endif

err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
(int)mode, len, (void *)&stuff[1], TRUE);
if (err != Success)
Expand Down
10 changes: 0 additions & 10 deletions nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,6 @@ InitRootWindow(WindowPtr pWin)

nxagentRedirectDefaultWindows();

#ifdef NXAGENT_ARTSD
{
char artsd_port[10];
int nPort;
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort);
nxagentPropagateArtsdProperties(pScreen, artsd_port);
}
#endif
}

/*****
Expand Down
195 changes: 0 additions & 195 deletions nx-X11/programs/Xserver/hw/nxagent/Screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@ ScreenPtr nxagentDefaultScreen = NULL;
int nxagentArgc = 0;
char **nxagentArgv = NULL;

#ifdef NXAGENT_ARTSD

char mcop_atom[] = "MCOPGLOBALS";
Atom mcop_local_atom = None;
unsigned char fromHexNibble(char c);
void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);

#endif

Window nxagentIconWindow = None;
Window nxagentFullscreenWindow = None;

Expand Down Expand Up @@ -3356,192 +3347,6 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
}
}

#ifdef NXAGENT_ARTSD

unsigned char fromHexNibble(char c)
{
int uc = (unsigned char)c;

if(uc >= '0' && uc <= '9') return uc - (unsigned char)'0';
if(uc >= 'a' && uc <= 'f') return uc + 10 - (unsigned char)'a';
if(uc >= 'A' && uc <= 'F') return uc + 10 - (unsigned char)'A';

return 16; /*error*/
}

void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port)
{
Window rootWin;
XlibAtom atomReturnType;
XlibAtom propAtom;
int iReturnFormat;
unsigned long ulReturnItems;
unsigned long ulReturnBytesLeft;
unsigned char *pszReturnData = NULL;
int iReturn;

int i,in;
char tchar[] = " ";
/*
FIXME: The port information is not used at the moment and produces a
warning on recent gcc versions. Do we need such information
to run the audio forawrding?

char *chport;
char hex[] = "0123456789abcdef";
*/
rootWin = DefaultRootWindow(nxagentDisplay);
propAtom = nxagentAtoms[4]; /* MCOPGLOBALS */

/*
* Get at most 64KB of data.
*/

iReturn = XGetWindowProperty(nxagentDisplay,
rootWin,
propAtom,
0,
65536 / 4,
False,
XA_STRING,
&atomReturnType,
&iReturnFormat,
&ulReturnItems,
&ulReturnBytesLeft,
&pszReturnData);

if (iReturn == Success && atomReturnType != None &&
ulReturnItems > 0 && pszReturnData != NULL)
{
char *local_buf;

#ifdef TEST
fprintf(stderr, "nxagentPropagateArtsdProperties: Got [%ld] elements of format [%d] with [%ld] bytes left.\n",
ulReturnItems, iReturnFormat, ulReturnBytesLeft);
#endif

#ifdef WARNING

if (ulReturnBytesLeft > 0)
{
fprintf(stderr, "nxagentPropagateArtsdProperties: WARNING! Could not get the whole ARTSD property data.\n");
}

#endif

local_buf = (char *) malloc(strlen((char*)pszReturnData) + 100);

if (local_buf)
{
memset(local_buf, 0, strlen((char *) pszReturnData));

for (i = 0, in = 0; pszReturnData[i] != '\0'; i++)
{
local_buf[in]=pszReturnData[i];

if(pszReturnData[i]==':')
{
i++;

while(pszReturnData[i]!='\n')
{
unsigned char h;
unsigned char l;

h = fromHexNibble(pszReturnData[i]);
i++;
if(pszReturnData[i]=='\0') continue;
l = fromHexNibble(pszReturnData[i]);
i++;

if(h >= 16 || l >= 16) continue;

/*
* FIXME: The array tchar[] was used uninitialized.
* It's not clear to me the original purpose of the
* piece of code using it. To be removed in future
* versions.
*/

tchar[0]=tchar[1];
tchar[1]=tchar[2];
tchar[2]=tchar[3];
tchar[3] = (h << 4) + l;
tchar[4]='\0';

if (strncmp(tchar, "tcp:", 4) == 0)
{
local_buf[in-7]='1';
local_buf[in-6]=strlen(port)+47;

in++;
local_buf[in]=pszReturnData[i-2];
in++;
local_buf[in]=pszReturnData[i-1];

strcat(local_buf,"6c6f63616c686f73743a");
in+=20;

/*
FIXME: The port information is not used at the moment and produces a
warning on recent gcc versions. Do we need such information
to run the audio forawrding?

chport=&port[0];

while(*chport!='\0')
{
in++;
local_buf[in]=hex[(*chport >> 4) & 0xf];
in++;
local_buf[in]=hex[*chport & 0xf];
*chport++;
}
*/
strcat(local_buf,"00");
in+=2;

while(pszReturnData[i]!='\n')
{
i++;
}
}
else
{
in++;
local_buf[in]=pszReturnData[i-2];
in++;
local_buf[in]=pszReturnData[i-1];
}
}

in++;
local_buf[in]=pszReturnData[i];
}

in++;
}

local_buf[in]=0;

if (strlen(local_buf))
{
mcop_local_atom = MakeAtom(mcop_atom, strlen(mcop_atom), 1);

ChangeWindowProperty(pScreen->root,
mcop_local_atom,
XA_STRING,
iReturnFormat, PropModeReplace,
strlen(local_buf), local_buf, 1);
}

free(local_buf);
}
}
}

#endif

Bool nxagentReconnectScreen(void *p0)
{
CARD16 w, h;
Expand Down