In the X Windowing System, there is (usually; we exclude situations like web kiosks here) a single special application whose responsibility is to look after the arrangement of windows (e.g., allowing people to drag them around and resize them) and the look and feel of the decorations of the window (title bar, frame, etc.). This application is called the window manager.
On Windows and Macintoshes, that responsibility is divided up slightly differently internally, but the net result is usually the same. (You should only see a significant difference when something crashes, and that shouldn't happen in the first place!)
Typically, applications communicate with window managers by providing them with hints; they can ask to be a certain size and at a certain position, but ultimately if the WM decides to put the window somewhere else (e.g., because the user moved or resized it) then there's nothing that the app can do about it. Nor should there be anything that the app can do about it; the user should be in control after all.
You use Tk's wm command to interact with the window manager.
Interesting related reading: an emerging window manager specification that extends ICCCM: [3 ]. See this recent article with members of freedesktop regarding their views of the direction desktop applications and libraries are headed [2 ]
[pertinence of xprop]
DKF: xprop? To understand that, you need to understand that every X window has a set of mappings called properties associated with it. Each is a mapping from an XAtom to a typed bunch of bytes. All sorts of things (including quite a lot of window management) are done using this mechanism, most of which Tk conceals from you (and with good reason; it's a very low level mechanism.) xprop is a little utility that allows you to probe these properties. Note that programs can also ask for an event whenever window properties change, and this is the foundation of all sorts of things (including the send mechanism on Unix/X systems.)
[Summary: it's hard for Tk to know what the WM is doing.]
Along with the term window manager is the term desktop environment, which involves not only managing windows, but protocols for session management, drag and drop, and more.
Two common desktop environments for Linux are GNOME and KDE; another is Enlightenment. Windows is both the desktop environment and window manager. MacOS X is more like Linux, in that one can select alternate window managers and desktop environments, but most Mac users use the desktop environment that Apple produces.
Currently, it is unknown if anyone has developed a Tcl interface to session management protocols. There have been efforts to support drag and drop, though I don't know if these efforts are compatible with either of the linux desktop environments.