Matching windows

window

You see that at the top level we have a list of <window> tags, one for each window state we discussed above. The style_set argument of each of these gives the name of a frame_style_set.

frame_style_set:

tells Metacity how to draw windows according to whether they're focused or not, maximised or not, shaded or not, and allowing resizing vertically, horizontally, both, or neither. It looks like this:

<frame_style_set>
<frame focus="F" state="S" resize="R" style="N"/>
<frame… />

…
</frame_style_set>

where:

F

is yes for focused, no for unfocused.

S

combines the shaded and maximized flags: normal, maximized, shaded, or maximized_and_shaded.

R

represents resize permissions that the window gives us: none, vertical, horizontal, or both. Frame settings for maximised windows, which can't be resized, don't have this attribute.

N is the name of a frame_style to apply to a window which has these attributes.

A frame_style_set tag may also have a "parent" tag, which should be the name of another frame_style_set. This means that if Metacity wants to know about a kind of window which that frame_style_set doesn't describe, it should look in the parent. Most of the more complicated tags in Metacity theme files also have a "parent" attribute which work the same way. This is particularly useful because, taken together, all the frame_style_sets in a theme file must be capable of matching every possible kind of window; if a window turns up that they can't match, there will be an error at runtime.

Let's recap what we've seen so far. The combination of a window, which matches a window's state (normal, dialog, and so forth), with an entry in the corresponding frame_style_set, which matches its focus, shadedness, maximisedness, and resize permissions where relevant, will allow you to make a list of rules to match any window against. The next piece of this puzzle lets you specify what Metacity should do with such windows once it's matched them.