Commit 84a403e2 authored by Mike Gabriel's avatar Mike Gabriel

Report Xlib-side window IDs to session.log in machine readable form. This…

Report Xlib-side window IDs to session.log in machine readable form. This feature can be enabled by the cmdline options -reportwids and -reportprivatewids.
parent 000a869b
...@@ -145,6 +145,8 @@ Bool nxagentUserDefaultDepth = False; ...@@ -145,6 +145,8 @@ Bool nxagentUserDefaultDepth = False;
struct UserGeometry nxagentUserGeometry = {0, 0, 0, 0, 0}; struct UserGeometry nxagentUserGeometry = {0, 0, 0, 0, 0};
Bool nxagentUserBorderWidth = False; Bool nxagentUserBorderWidth = False;
int nxagentNumScreens = 0; int nxagentNumScreens = 0;
Bool nxagentReportWindowIds = False;
Bool nxagentReportPrivateWindowIds = False;
Bool nxagentDoDirectColormaps = False; Bool nxagentDoDirectColormaps = False;
Window nxagentParentWindow = 0; Window nxagentParentWindow = 0;
Bool nxagentIpaq = False; Bool nxagentIpaq = False;
...@@ -410,6 +412,16 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -410,6 +412,16 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return 1; return 1;
} }
if (!strcmp(argv[i], "-reportwids")) {
nxagentReportWindowIds = True;
return 1;
}
if (!strcmp(argv[i], "-reportprivatewids")) {
nxagentReportPrivateWindowIds = True;
return 1;
}
if (!strcmp(argv[i], "-full")) { if (!strcmp(argv[i], "-full")) {
nxagentFullGeneration = True; nxagentFullGeneration = True;
return 1; return 1;
......
...@@ -198,6 +198,7 @@ unsigned long startTime; ...@@ -198,6 +198,7 @@ unsigned long startTime;
*/ */
extern void RejectWellKnownSockets(void); extern void RejectWellKnownSockets(void);
extern Bool nxagentReportWindowIds;
int nxagentServerOrder() int nxagentServerOrder()
{ {
...@@ -1334,8 +1335,12 @@ FIXME: Use of nxagentParentWindow is strongly deprecated. ...@@ -1334,8 +1335,12 @@ FIXME: Use of nxagentParentWindow is strongly deprecated.
CopyFromParent, CopyFromParent,
0L, NULL); 0L, NULL);
if (nxagentReportWindowIds) {
fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n",
nxagentConfineWindow);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenDisplay: Created agent's confine window with id [%ld].\n", fprintf(stderr, "nxagentOpenDisplay: Created agent's confine window with id [0x%x].\n",
nxagentConfineWindow); nxagentConfineWindow);
#endif #endif
...@@ -2842,8 +2847,12 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2842,8 +2847,12 @@ Bool nxagentReconnectDisplay(void *p0)
CopyFromParent, CopyFromParent,
0L, NULL); 0L, NULL);
if (nxagentReportWindowIds) {
fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n",
nxagentConfineWindow);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentReconnectDisplay: Created agent's confine window with id [%ld].\n", fprintf(stderr, "nxagentReconnectDisplay: Created agent's confine window with id [0x%x].\n",
nxagentConfineWindow); nxagentConfineWindow);
#endif #endif
......
...@@ -139,6 +139,8 @@ extern Pixmap nxagentIconPixmap; ...@@ -139,6 +139,8 @@ extern Pixmap nxagentIconPixmap;
extern Pixmap nxagentIconShape; extern Pixmap nxagentIconShape;
extern Bool useXpmIcon; extern Bool useXpmIcon;
extern Bool nxagentReportWindowIds;
Window nxagentDefaultWindows[MAXSCREENS]; Window nxagentDefaultWindows[MAXSCREENS];
Window nxagentInputWindows[MAXSCREENS]; Window nxagentInputWindows[MAXSCREENS];
Window nxagentScreenSaverWindows[MAXSCREENS]; Window nxagentScreenSaverWindows[MAXSCREENS];
...@@ -396,9 +398,13 @@ Window nxagentCreateIconWindow() ...@@ -396,9 +398,13 @@ Window nxagentCreateIconWindow()
DefaultVisual(nxagentDisplay, DefaultScreen(nxagentDisplay)), DefaultVisual(nxagentDisplay, DefaultScreen(nxagentDisplay)),
valuemask, &attributes); valuemask, &attributes);
if (nxagentReportWindowIds)
{
fprintf (stderr, "NXAGENT_WINDOW_ID: ICON_WINDOW,WID:[0x%x]\n", nxagentIconWindow);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%lu].\n", fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [0x%x].\n",
(long unsigned int)nxagentIconWindow); nxagentIconWindow);
#endif #endif
/* /*
...@@ -1760,9 +1766,13 @@ N/A ...@@ -1760,9 +1766,13 @@ N/A
valuemask , &attributes); valuemask , &attributes);
} }
if (nxagentReportWindowIds)
{
fprintf (stderr, "NXAGENT_WINDOW_ID: SCREEN_WINDOW:[%d],WID:[0x%x]\n", pScreen -> myNum, nxagentInputWindows[pScreen->myNum]);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Created new default window with id [%ld].\n", fprintf(stderr, "nxagentOpenScreen: Created new default window with id [0x%x].\n",
(long int)nxagentDefaultWindows[pScreen->myNum]); nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
/* /*
......
...@@ -116,6 +116,8 @@ extern WindowPtr nxagentViewportFrameBelow; ...@@ -116,6 +116,8 @@ extern WindowPtr nxagentViewportFrameBelow;
extern WindowPtr nxagentRootTileWindow; extern WindowPtr nxagentRootTileWindow;
extern Bool nxagentReportPrivateWindowIds;
/* /*
* Also referenced in Events.c. * Also referenced in Events.c.
*/ */
...@@ -433,8 +435,12 @@ FIXME: We need to set save under on the real display? ...@@ -433,8 +435,12 @@ FIXME: We need to set save under on the real display?
} }
} }
if (nxagentReportPrivateWindowIds)
{
fprintf (stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x]\n", nxagentWindowPriv(pWin)->window);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreateWindow: Created new window with id [%ld].\n", fprintf(stderr, "nxagentCreateWindow: Created new window with id [0x%x].\n",
nxagentWindowPriv(pWin)->window); nxagentWindowPriv(pWin)->window);
#endif #endif
...@@ -3016,8 +3022,12 @@ FIXME: Do we need to set save unders attribute here? ...@@ -3016,8 +3022,12 @@ FIXME: Do we need to set save unders attribute here?
mask, mask,
&attributes); &attributes);
if (nxagentReportPrivateWindowIds)
{
fprintf (stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x]\n", nxagentWindowPriv(pWin)->window);
}
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentReconnectWindow: Created new window with id [%ld].\n", fprintf(stderr, "nxagentReconnectWindow: Created new window with id [0x%x].\n",
nxagentWindowPriv(pWin)->window); nxagentWindowPriv(pWin)->window);
#endif #endif
......
...@@ -372,6 +372,12 @@ force use of NX protocol messages assuming communication through nxproxy ...@@ -372,6 +372,12 @@ force use of NX protocol messages assuming communication through nxproxy
.B \-nxrealwindowprop .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 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 \-reportwids
explicitly tell NX Agent to report its externally exposed X11 window IDs to the session log (in machine readable form), so that external parsers can obtain that information from there
.TP 8
.B \-reportprivatewids
explicitly tell NX Agent to report X11 window IDs of internally created window objects to the session log (in machine readable form), so that external parsers can obtain that information from there; this creates a lot of output and may affect performance
.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)
.TP 8 .TP 8
......
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