Overview of what Metacity does when it's told that various gconf prefs have been updated, mostly for ThomasThurman's benefit in refactoring.
All prefs are constrained to be of one particular type. Only three of these types are used: string, int, and bool. If an attempt is made to set a known pref to a value of an invalid type, a warning is issued and no update is made.
Strings
These have been refactored. In practice it was found convenient to split these up into enums (marked "symtab" below) and strings (all the others).
This is the most complicated group. Many of these are simple case-insensitive mappings of strings to enums, with a failure case (discussed later) if there is no exact match, and a simple updating of the value in core if there is. These are marked with "symtab" below.
A pref's value will be null if and only if the key is deleted. It happens that the effect of giving any symtab key an invalid symbol is equivalent to that of giving it a null value, except that Metacity will also issue a warning.
key |
action |
if destroyed (or supplied with an invalid enum, for symtabs) |
META_PREF_MOUSE_BUTTON_MODS |
results of passing value through meta_ui_parse_modifier() written into core |
stays the same |
META_PREF_FOCUS_MODE |
symtab |
stays the same |
META_PREF_FOCUS_NEW_WINDOWS |
symtab |
stays the same |
META_PREF_THEME |
any value is strdupped into core, except the empty string, for which see the next column |
the string "Atlanta" is strdupped into core |
META_PREF_TITLEBAR_FONT |
value passed to pango to produce font; if error, gives warning; thereafter see next column |
causes the font actually to be set to null, which is externally indistinguishable from use_system_font being true, although it does not actually set use_system_font to true |
META_PREF_TERMINAL_COMMAND |
any value is strdupped into core |
stays the same |
META_PREF_BUTTON_LAYOUT |
results of passing value through parser in update_button_layout() written into core |
stays the same |
META_PREF_VISUAL_BELL_TYPE |
symtab |
Possible bug: causes the bell type to be set to "fullscreen" in all cases. |
META_PREF_CURSOR_THEME |
any value is strdupped into core |
stays the same |
META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR |
symtab |
stays the same |
META_PREF_ACTION_MIDDLE_CLICK_TITLEBAR |
symtab |
stays the same |
META_PREF_ACTION_RIGHT_CLICK_TITLEBAR |
symtab |
stays the same |
Ints
These have NOT been refactored.
Quite rare in the big scheme of things. Each one is range-checked against a pair of constant integers; if it succeeds, it is written out to an int in core; if it fails, a warning is issued and nothing else happens. It would be quite easy to make these more regular, except that the defaults for when a pref is destroyed are constants in some cases and variables in others.
key |
at least |
at most |
if destroyed |
META_PREF_NUM_WORKSPACES |
1 |
MAX_REASONABLE_WORKSPACES (a macro constant) |
don't change (ultimate default is 4) |
META_PREF_AUTO_RAISE_DELAY |
0 |
MAX_REASONABLE_AUTO_RAISE_DELAY (a macro constant) |
0 |
META_PREF_CURSOR_SIZE |
1 |
128 |
24 |
Bools
These have been refactored.
All these functions simply take the new value and write it into a variable in core; one of them also issues a warning, one of them is unusual because it shares a pref enum, and one of them is actually disconnected in practice.
key |
action |
if destroyed |
META_PREF_RAISE_ON_CLICK |
generic |
becomes TRUE |
..._USE_SYSTEM_FONT |
generic, except that we queue on META_PREF_TITLEBAR_FONT and not META_PREF_USE_SYSTEM_FONT which doesn't exist |
becomes TRUE |
META_PREF_APPLICATION_BASED |
generic (theoretically, but updates to this pref are always ignored) |
n/a (theoretically stays the same) |
META_PREF_DISABLE_WORKAROUNDS |
generic, plus causes a meta_warning() on the first change |
stays the same |
META_PREF_AUTO_RAISE |
generic |
stays the same |
META_PREF_VISUAL_BELL |
generic (weirdly, these two functions use the same update function, but are distinct) |
stays the same |
META_PREF_AUDIBLE_BELL |
generic (but see previous) |
stays the same |
META_PREF_REDUCED_RESOURCES |
generic |
stays the same |
META_PREF_GNOME_ACCESSIBILITY |
generic |
stays the same |
META_PREF_COMPOSITING_MANAGER |
generic |
stays the same |
Lists
There are also some entries which are possibly held as lists. This needs further thought.