benson@ksr.UUCP (Benson Margulies) (06/11/88)
Running X11R2, latest fixes, SunOS 3.5. I create slave xterms with -SppDD Like all xterms around here, they are setuid root. So I can't get rid of them by killing the xterm process. Closing the slave end of the pty is an unreliable, or at least slow, way to get rid of them. So, thought I, how about that Window that is wrtten back to the slave in hex? The windowID written back never matches what xwininfo has to say. further, XDestroyWindow(XOpenDisplay(NULL), strtol(widstr, NULL, 16)) with widstr fgets'ed from the slave, takes a protocol error, complaining that the window id is not a valid windowid. Can anyone offer any assistance? -- Benson I. Margulies Kendall Square Research Corp. harvard!ksr!benson ksr!benson@harvard.harvard.edu
rpd@CS.CMU.EDU (Richard Draves) (06/12/88)
Perhaps the tty is in some kind of cooked mode, so that the high bits in the window id are getting dropped? I had this problem with the X10 xterm. Rich
jim@EXPO.LCS.MIT.EDU (Jim Fulton) (06/13/88)
The window id that was being printed was that of the widget, not of the top
level window. If you change the paragraph in main.c that writes out the window
id to the following, it should work (i.e. my test program gave the right
result):
if (am_slave) { /* Write window id so master end can read and use */
char buf[80];
buf[0] = '\0';
sprintf (buf, "%lx\n",
screen->TekEmu ? XtWindow (XtParent (tekWidget)) :
XtWindow (XtParent (term)));
write (pty, buf, strlen (buf));
}
Jim Fulton
MIT X Consortium
benson@ksr.UUCP (Benson I. Margulies Kendall Square Research Corp.) (06/13/88)
Two questions: 1) do you consider this a bug that will be fixed in a future release? 2) Why dosen't XQueryTree want to give me the parent, or anything else? (That is, I changed my code to call XQueryTree on the WINDOWID and it still took a protocol error bitching of an invalid window id.) Are Widgets not the same sort of thing as windows.