Commit 8d00456a authored by Mike Gabriel's avatar Mike Gabriel Committed by Mihai Moldovan

nxagent: Add support for optionally enabling/disabling the magic pixel feature.

Fixes ArcticaProject/nx-libs#657.
parent 05152b78
......@@ -676,6 +676,10 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 1;
}
if (!strcmp(argv[i], "-nomagicpixel")) {
nxagentChangeOption(MagicPixel, 0);
return 1;
}
if (!strcmp(argv[i], "-noonce"))
{
......@@ -1246,6 +1250,19 @@ static void nxagentParseOptions(char *name, char *value)
return;
}
else if (!strcmp(name, "magicpixel"))
{
if (!strcmp(value, "0"))
{
nxagentChangeOption(MagicPixel, 0);
}
else
{
nxagentChangeOption(MagicPixel, 1);
}
return;
}
else if (strcmp(name, "shadowuid") == 0)
{
nxagentShadowUid = atoi(value);
......@@ -2075,6 +2092,7 @@ void ddxUseMsg()
ErrorF("-forcenx force use of NX protocol messages assuming communication through nxproxy\n");
ErrorF("-timeout int auto-disconnect timeout in seconds (minimum allowed: 60)\n");
ErrorF("-norootlessexit don't exit if there are no clients in rootless mode\n");
ErrorF("-nomagicpixel disable nxagent's magic pixel\n");
#ifdef RENDER
ErrorF("-norender disable the use of the render extension\n");
ErrorF("-nocomposite disable the use of the composite extension\n");
......
......@@ -1218,7 +1218,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (nxagentOption(Fullscreen))
{
if (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y))
if ( (nxagentOption(MagicPixel) == 1) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) )
{
pScreen = nxagentScreen(X.xbutton.window);
......
......@@ -155,6 +155,8 @@ void nxagentInitOptions()
nxagentOptions.Menu = 1;
nxagentOptions.MagicPixel = 1;
nxagentOptions.ClientOs = UNDEFINED;
nxagentOptions.InhibitXkb = 1;
......
......@@ -386,6 +386,12 @@ typedef struct _AgentOptions
int Menu;
/*
* Enabling/disabling the magic pixel.
*/
int MagicPixel;
/*
* Specify the Operative System of the client.
*/
......
......@@ -399,6 +399,10 @@ auto-disconnect timeout in seconds (minimum allowed: 60)
.B \-norootlessexit
don't exit if there are no clients in rootless mode
.TP 8
.B \-nomagicpixel
disable magic pixel support at session startup, can be re-enabled via nx/nx option on session
resumption
.TP 8
.B \-norender
disable the use of the render extension
.TP 8
......@@ -599,6 +603,9 @@ overrides the command line default.
support pulldown menu in \fBnxagent\fR session (only available on
proxy <-> agent remote sessions)
.TP 8
.B magicpixel=<int>
enable/disable magic pixel support in fullscreen mode (default: 1, enabled)
.TP 8
.B sleep=<int>
delay X server operations when suspended (provided in msec), set to
\fI0\fR to keep \fBnxagent\fR session fully functional when suspended
......
......@@ -8474,6 +8474,7 @@ int ParseEnvironmentOptions(const char *env, int force)
else if (strcasecmp(name, "defer") == 0 ||
strcasecmp(name, "tile") == 0 ||
strcasecmp(name, "menu") == 0 ||
strcasecmp(name, "magicpixel") == 0 ||
strcasecmp(name, "state") == 0 )
{
nxdbg << "Loop: Ignoring agent option '" << name
......
......@@ -343,6 +343,7 @@ shadowmode=s\n\
defer=n\n\
tile=s\n\
menu=n\n\
magicpixel=n\n\
sleep=n\n\
tolerancechecks=s\n\
keyconv=s\n\
......
......@@ -327,6 +327,7 @@ encryption of the point to point communication.
defer=<int>
tile=<string>
menu=<int>
magicpixel=<int>
sleep=<int>
.SH NX ENVIRONMENT VARIABLES
......
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