[FreeNX-kNX] Obtaining the X Windows ID of the NX window

Seb James seb at esfnet.co.uk
Tue Sep 25 09:46:32 UTC 2007


Hi List,

An NX Client program is likely to want to manipulate the window which
appears on the screen. It might want to do this to dock the new window
in a tab of a tabbed window, for example.

This is quite easy to do, so long as you know the X window ID of the
window that you want to dock.

Unfortunately, I don't think the NX protocol returns this datum at
present.

As far as I can see from a quick look through the NX sources, it looks
like nxagent needs to report the X window ID back to nxserver, which can
then pass that information back down the nxssh channel in a message,
which could look something like:

NX> 999 X Window ID:2341

Or it could send the information directly to the nxproxy running on the
client (X server) machine. This would be neater, as we could patch the
NX sources without NoMachine needing to modify their nxserver, or the
freenx project needing to change the freenx server.

In the nxagent sources, you can get the window ID using this macro:

nxagentWindow (pWin);

which is defined at line 108 in the 3.0 sources I have here. It just
returns a member of the pWin datastructure. So, the window ID is right
there for the taking.

The question is - what's the best way to return this information to the
client. Can we do it just by patching nxagent and libXcomp/nxproxy, or
do we need to include nxserver, to pass the information back via nxssh?

Any thoughts?

Seb James





More information about the FreeNX-kNX mailing list