Unverified Commit 4365fe38 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'sunweaver-pr/nx-real-wid' into 3.6.x

Attributes GH PR #463: https://github.com/ArcticaProject/nx-libs/pull/463 Reviewed by Ulrich Sibiller <uli42@gmx.de> -- Fri, 30 Jun 2017 14:16:03 +0000 (UTC)
parents 3d255540 588be638
...@@ -128,6 +128,7 @@ extern const char *__progname; ...@@ -128,6 +128,7 @@ extern const char *__progname;
char nxagentDisplayName[1024]; char nxagentDisplayName[1024];
Bool nxagentSynchronize = False; Bool nxagentSynchronize = False;
Bool nxagentRealWindowProp = False;
char nxagentShadowDisplayName[1024] = {0}; char nxagentShadowDisplayName[1024] = {0};
...@@ -404,6 +405,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -404,6 +405,11 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 1; return 1;
} }
if (!strcmp(argv[i], "-nxrealwindowprop")) {
nxagentRealWindowProp = True;
return 1;
}
if (!strcmp(argv[i], "-full")) { if (!strcmp(argv[i], "-full")) {
nxagentFullGeneration = True; nxagentFullGeneration = True;
return 1; return 1;
......
...@@ -59,6 +59,7 @@ extern char nxagentWindowName[]; ...@@ -59,6 +59,7 @@ extern char nxagentWindowName[];
extern char nxagentDialogName[]; extern char nxagentDialogName[];
extern Bool nxagentSynchronize; extern Bool nxagentSynchronize;
extern Bool nxagentRealWindowProp;
extern Bool nxagentFullGeneration; extern Bool nxagentFullGeneration;
extern int nxagentDefaultClass; extern int nxagentDefaultClass;
extern Bool nxagentUserDefaultClass; extern Bool nxagentUserDefaultClass;
......
...@@ -53,6 +53,11 @@ ...@@ -53,6 +53,11 @@
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
#ifdef DEBUG
/* for validateString() */
#include "Utils.h"
#endif
/* /*
* These values should be moved in * These values should be moved in
* the option repository. * the option repository.
......
...@@ -466,6 +466,18 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin) ...@@ -466,6 +466,18 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin)
nxagentRedirectWindow(pWin); nxagentRedirectWindow(pWin);
} }
if ((nxagentRealWindowProp) && (!nxagentWindowTopLevel(pWin)))
{
Atom prop = MakeAtom("NX_REAL_WINDOW", strlen("NX_REAL_WINDOW"), True);
if (ChangeWindowProperty(pWin, prop, XA_WINDOW, 32, PropModeReplace, 1, nxagentWindowPriv(pWin), 1) != Success)
fprintf(stderr, "nxagentCreateWindow: Adding NX_REAL_WINDOW failed.\n");
#ifdef DEBUG
else
fprintf(stderr, "nxagentCreateWindow: Added NX_REAL_WINDOW for Window ID [%x].\n", nxagentWindowPriv(pWin)->window);
#endif
}
nxagentWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin); nxagentWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin);
nxagentWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin); nxagentWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin);
nxagentWindowPriv(pWin)->width = pWin->drawable.width; nxagentWindowPriv(pWin)->width = pWin->drawable.width;
...@@ -2674,6 +2686,18 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2) ...@@ -2674,6 +2686,18 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2)
} }
#endif #endif
if ((nxagentRealWindowProp) && (!nxagentWindowTopLevel(pWin)))
{
Atom prop = MakeAtom("NX_REAL_WINDOW", strlen("NX_REAL_WINDOW"), True);
if (DeleteProperty(pWin, prop) != Success)
fprintf(stderr, "nxagentDisconnectWindow: Deleting NX_REAL_WINDOW failed.\n");
#ifdef DEBUG
else
fprintf(stderr, "nxagentDisconnectWindow: Deleting NX_REAL_WINDOW from Window ID [%x].\n", nxagentWindowPriv(pWin)->window);
#endif
}
nxagentWindow(pWin) = None; nxagentWindow(pWin) = None;
if (nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) if (nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized)
...@@ -3111,6 +3135,18 @@ FIXME: Do we need to set save unders attribute here? ...@@ -3111,6 +3135,18 @@ FIXME: Do we need to set save unders attribute here?
} }
} }
if ((nxagentRealWindowProp) && (!nxagentWindowTopLevel(pWin)))
{
Atom prop = MakeAtom("NX_REAL_WINDOW", strlen("NX_REAL_WINDOW"), True);
if (ChangeWindowProperty(pWin, prop, XA_WINDOW, 32, PropModeReplace, 1, nxagentWindowPriv(pWin), 1) != Success)
fprintf(stderr, "nxagentReconnectWindow: Updating NX_REAL_WINDOW failed.\n");
#ifdef DEBUG
else
fprintf(stderr, "nxagentReconnectWindow: Updated NX_REAL_WINDOW for Window ID [%x].\n", nxagentWindowPriv(pWin)->window);
#endif
}
if (nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) if (nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized)
{ {
nxagentAllocateCorruptedResource((DrawablePtr) pWin, RT_NX_CORR_WINDOW); nxagentAllocateCorruptedResource((DrawablePtr) pWin, RT_NX_CORR_WINDOW);
......
...@@ -368,6 +368,8 @@ The nx-X11 system adds the following command line arguments: ...@@ -368,6 +368,8 @@ The nx-X11 system adds the following command line arguments:
.TP 8 .TP 8
.B \-forcenx .B \-forcenx
force use of NX protocol messages assuming communication through nxproxy force use of NX protocol messages assuming communication through nxproxy
.B \-nxrealwindowprop
set property NX_REAL_WINDOW for each X11 client inside NX Agent, providing the window XID of the corresponding window object on the X server that NX Agent runs on
.TP 8 .TP 8
.B \-timeout \fIint\fP .B \-timeout \fIint\fP
auto-disconnect timeout in seconds (minimum allowed: 60) auto-disconnect timeout in seconds (minimum allowed: 60)
......
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