ICCCM

The X11 Inter-Client Communications Conventions Manual [L1 ]

"The ICCCM is generally the M in "RTFM" and is the most-important of the least-read X documents."

This document specifies how X clients interact with each other. It explains how to use the X selection mechanism, how to interact with the Window manager (and what a window manager is), session management, and how to manage shared resources like the keyboard focus and colormaps.

The Tk toolkit handles most of the ICCCM conventions internally, so as an application writer you don't need to worry about it too much. It's good reading though if you want to know what's really going on with the clipboard or what happens when you execute selection get.


This from the Tk Usage FAQ [L2 ]:

Is Tk fully ICCCM compliant?

In short, no. However, it is possible to make Tk more ICCCM compliant through the use of a few wm methods. The following are a couple examples which effect window manager interaction:

    wm command . "$argv0 $argv"
    wm client . [info hostname]

Actually, this does not follow proper list structure. It's better to use:

    wm command . [linsert $argv 0 $argv0]

For compatibility with xsm session manager (comes with X.org X server) and smproxy session proxy, you can define:

    wm client . [ info hostname ]
    wm protocol . WM_SAVE_YOURSELF save

    proc save {} {
        global argv0 argv
        ...
        # Tell smproxy that state saving is finished
        wm command . [ linsert $argv 0 $argv0 ]
    }

Note that wm command used inside the WM_SAVE_YOURSELF handler.

DKF: In fact, this is currently what you have to do to comply with the standard session protocol. Tk really ought to handle this stuff for you so that you can just set wm command when its value changes, and Tk will then take care of the response to the WM_SAVE_YOURSELF message (in the case that you don't want to actually do something like saving a backup file, of course).


See also