GNOME Bugzilla – Bug 420587
The value of WINDOWID env var isn't correct.
Last modified: 2008-06-16 20:14:53 UTC
This is Debian bug #387884. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=387884 "When I print with echo the value of WINDOWID environment variable, it's not correct. I compare it with the value reported by xwininfo." Values given by xwininfo by selecting window manually: xwininfo: Window id: 0x3800020 Absolute upper-left X: 694 Absolute upper-left Y: 294 Relative upper-left X: 5 Relative upper-left Y: 25 Values given by xwininfo by providing the id from $WINDOWID: xwininfo: Window id: 0x380004e Absolute upper-left X: 694 Absolute upper-left Y: 315 Relative upper-left X: 0 Relative upper-left Y: 21 In xterm for example, these two examples match.
I think WINDOWID is set to the child X window that corresponds to the terminal display. xterm doesn't have nested windows in the same way as gnome-terminal. Though, who knows if there is really any spec for what WINDOWID is set to, I believe the reason it's set to the child window is to allow horrible hacks like terminal web browsers that connect to X to display images. It's hard to imagine a use of WINDOWID that isn't a horrible hack, really. If you need the toplevel window, just walk up the X window tree with Xlib calls.
Agree with Havoc and ChPe.