add a config option hideDisabled in the theme section that hides disabled buttons...
[dana/openbox.git] / openbox / config.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    config.c for the Openbox window manager
4    Copyright (c) 2004        Mikael Magnusson
5    Copyright (c) 2003        Ben Jansens
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 #include "config.h"
21 #include "keyboard.h"
22 #include "mouse.h"
23 #include "prop.h"
24 #include "translate.h"
25 #include "parser/parse.h"
26 #include "openbox.h"
27
28 gboolean config_focus_new;
29 gboolean config_focus_follow;
30 guint    config_focus_delay;
31 gboolean config_focus_raise;
32 gboolean config_focus_last;
33
34 ObPlacePolicy config_place_policy;
35
36 gchar   *config_theme;
37 gboolean config_theme_keepborder;
38 gboolean config_theme_hidedisabled;
39
40 gchar *config_title_layout;
41
42 gint    config_desktops_num;
43 GSList *config_desktops_names;
44 gint    config_screen_firstdesk;
45
46 gboolean config_resize_redraw;
47 gboolean config_resize_four_corners;
48 gint     config_resize_popup_show;
49 gint     config_resize_popup_pos;
50
51 ObStackingLayer config_dock_layer;
52 gboolean        config_dock_floating;
53 gboolean        config_dock_nostrut;
54 ObDirection     config_dock_pos;
55 gint            config_dock_x;
56 gint            config_dock_y;
57 ObOrientation   config_dock_orient;
58 gboolean        config_dock_hide;
59 guint           config_dock_hide_delay;
60 guint           config_dock_app_move_button;
61 guint           config_dock_app_move_modifiers;
62
63 guint config_keyboard_reset_keycode;
64 guint config_keyboard_reset_state;
65
66 gint config_mouse_threshold;
67 gint config_mouse_dclicktime;
68
69 gboolean config_menu_warppointer;
70 gboolean config_menu_xorstyle;
71 guint    config_menu_hide_delay;
72 gboolean config_menu_client_list_icons;
73
74 GSList *config_menu_files;
75
76 gint config_resist_win;
77 gint config_resist_edge;
78
79 gboolean config_resist_layers_below;
80
81 /*
82
83 <keybind key="C-x">
84   <action name="ChangeDesktop">
85     <desktop>3</desktop>
86   </action>
87 </keybind>
88
89 */
90
91 static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
92                       GList *keylist)
93 {
94     gchar *key;
95     ObAction *action;
96     xmlNodePtr n, nact;
97     GList *it;
98
99     if ((n = parse_find_node("chainQuitKey", node))) {
100         key = parse_string(doc, n);
101         translate_key(key, &config_keyboard_reset_state,
102                       &config_keyboard_reset_keycode);
103         g_free(key);
104     }
105
106     n = parse_find_node("keybind", node);
107     while (n) {
108         if (parse_attr_string("key", n, &key)) {
109             keylist = g_list_append(keylist, key);
110
111             parse_key(i, doc, n->children, keylist);
112
113             it = g_list_last(keylist);
114             g_free(it->data);
115             keylist = g_list_delete_link(keylist, it);
116         }
117         n = parse_find_node("keybind", n->next);
118     }
119     if (keylist) {
120         nact = parse_find_node("action", node);
121         while (nact) {
122             if ((action = action_parse(i, doc, nact,
123                                        OB_USER_ACTION_KEYBOARD_KEY)))
124                 keyboard_bind(keylist, action);
125             nact = parse_find_node("action", nact->next);
126         }
127     }
128 }
129
130 static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
131                            gpointer d)
132 {
133     keyboard_unbind_all();
134
135     parse_key(i, doc, node->children, NULL);
136 }
137
138 /*
139
140 <context name="Titlebar"> 
141   <mousebind button="Left" action="Press">
142     <action name="Raise"></action>
143   </mousebind>
144 </context>
145
146 */
147
148 static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
149                         gpointer d)
150 {
151     xmlNodePtr n, nbut, nact;
152     gchar *buttonstr;
153     gchar *contextstr;
154     ObUserAction uact;
155     ObMouseAction mact;
156     ObAction *action;
157
158     mouse_unbind_all();
159
160     node = node->children;
161     
162     if ((n = parse_find_node("dragThreshold", node)))
163         config_mouse_threshold = parse_int(doc, n);
164     if ((n = parse_find_node("doubleClickTime", node)))
165         config_mouse_dclicktime = parse_int(doc, n);
166
167     n = parse_find_node("context", node);
168     while (n) {
169         if (!parse_attr_string("name", n, &contextstr))
170             goto next_n;
171         nbut = parse_find_node("mousebind", n->children);
172         while (nbut) {
173             if (!parse_attr_string("button", nbut, &buttonstr))
174                 goto next_nbut;
175             if (parse_attr_contains("press", nbut, "action")) {
176                 uact = OB_USER_ACTION_MOUSE_PRESS;
177                 mact = OB_MOUSE_ACTION_PRESS;
178             } else if (parse_attr_contains("release", nbut, "action")) {
179                 uact = OB_USER_ACTION_MOUSE_RELEASE;
180                 mact = OB_MOUSE_ACTION_RELEASE;
181             } else if (parse_attr_contains("click", nbut, "action")) {
182                 uact = OB_USER_ACTION_MOUSE_CLICK;
183                 mact = OB_MOUSE_ACTION_CLICK;
184             } else if (parse_attr_contains("doubleclick", nbut,"action")) {
185                 uact = OB_USER_ACTION_MOUSE_DOUBLE_CLICK;
186                 mact = OB_MOUSE_ACTION_DOUBLE_CLICK;
187             } else if (parse_attr_contains("drag", nbut, "action")) {
188                 uact = OB_USER_ACTION_MOUSE_MOTION;
189                 mact = OB_MOUSE_ACTION_MOTION;
190             } else
191                 goto next_nbut;
192             nact = parse_find_node("action", nbut->children);
193             while (nact) {
194                 if ((action = action_parse(i, doc, nact, uact)))
195                     mouse_bind(buttonstr, contextstr, mact, action);
196                 nact = parse_find_node("action", nact->next);
197             }
198             g_free(buttonstr);
199         next_nbut:
200             nbut = parse_find_node("mousebind", nbut->next);
201         }
202         g_free(contextstr);
203     next_n:
204         n = parse_find_node("context", n->next);
205     }
206 }
207
208 static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
209                         gpointer d)
210 {
211     xmlNodePtr n;
212
213     node = node->children;
214     
215     if ((n = parse_find_node("focusNew", node)))
216         config_focus_new = parse_bool(doc, n);
217     if ((n = parse_find_node("followMouse", node)))
218         config_focus_follow = parse_bool(doc, n);
219     if ((n = parse_find_node("focusDelay", node)))
220         config_focus_delay = parse_int(doc, n) * 1000;
221     if ((n = parse_find_node("raiseOnFocus", node)))
222         config_focus_raise = parse_bool(doc, n);
223     if ((n = parse_find_node("focusLast", node)))
224         config_focus_last = parse_bool(doc, n);
225 }
226
227 static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
228                             gpointer d)
229 {
230     xmlNodePtr n;
231
232     node = node->children;
233     
234     if ((n = parse_find_node("policy", node)))
235         if (parse_contains("UnderMouse", doc, n))
236             config_place_policy = OB_PLACE_POLICY_MOUSE;
237 }
238
239 static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
240                         gpointer d)
241 {
242     xmlNodePtr n;
243
244     node = node->children;
245
246     if ((n = parse_find_node("name", node))) {
247         gchar *c;
248
249         g_free(config_theme);
250         c = parse_string(doc, n);
251         config_theme = parse_expand_tilde(c);
252         g_free(c);
253     }
254     if ((n = parse_find_node("titleLayout", node))) {
255         g_free(config_title_layout);
256         config_title_layout = parse_string(doc, n);
257     }
258     if ((n = parse_find_node("keepBorder", node)))
259         config_theme_keepborder = parse_bool(doc, n);
260     if ((n = parse_find_node("hideDisabled", node)))
261         config_theme_hidedisabled = parse_bool(doc, n);
262 }
263
264 static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
265                            gpointer d)
266 {
267     xmlNodePtr n;
268
269     node = node->children;
270     
271     if ((n = parse_find_node("number", node))) {
272         gint d = parse_int(doc, n);
273         if (d > 0)
274             config_desktops_num = d;
275     }
276     if ((n = parse_find_node("firstdesk", node))) {
277         gint d = parse_int(doc, n);
278         if (d > 0)
279             config_screen_firstdesk = d;
280     }
281     if ((n = parse_find_node("names", node))) {
282         GSList *it;
283         xmlNodePtr nname;
284
285         for (it = config_desktops_names; it; it = it->next)
286             g_free(it->data);
287         g_slist_free(config_desktops_names);
288         config_desktops_names = NULL;
289
290         nname = parse_find_node("name", n->children);
291         while (nname) {
292             config_desktops_names = g_slist_append(config_desktops_names,
293                                                    parse_string(doc, nname));
294             nname = parse_find_node("name", nname->next);
295         }
296     }
297 }
298
299 static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
300                          gpointer d)
301 {
302     xmlNodePtr n;
303
304     node = node->children;
305     
306     if ((n = parse_find_node("drawContents", node)))
307         config_resize_redraw = parse_bool(doc, n);
308     if ((n = parse_find_node("fourCorner", node)))
309         config_resize_four_corners = parse_bool(doc, n);
310     if ((n = parse_find_node("popupShow", node))) {
311         config_resize_popup_show = parse_int(doc, n);
312         if (parse_contains("Always", doc, n))
313             config_resize_popup_show = 2;
314         else if (parse_contains("Never", doc, n))
315             config_resize_popup_show = 0;
316         else if (parse_contains("Nonpixel", doc, n))
317             config_resize_popup_show = 1;
318     }
319     if ((n = parse_find_node("popupPosition", node))) {
320         config_resize_popup_pos = parse_int(doc, n);
321         if (parse_contains("Top", doc, n))
322             config_resize_popup_pos = 1;
323         else if (parse_contains("Center", doc, n))
324             config_resize_popup_pos = 0;
325     }
326 }
327
328 static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
329                        gpointer d)
330 {
331     xmlNodePtr n;
332
333     node = node->children;
334
335     if ((n = parse_find_node("position", node))) {
336         if (parse_contains("TopLeft", doc, n))
337             config_dock_floating = FALSE,
338             config_dock_pos = OB_DIRECTION_NORTHWEST;
339         else if (parse_contains("Top", doc, n))
340             config_dock_floating = FALSE,
341             config_dock_pos = OB_DIRECTION_NORTH;
342         else if (parse_contains("TopRight", doc, n))
343             config_dock_floating = FALSE,
344             config_dock_pos = OB_DIRECTION_NORTHEAST;
345         else if (parse_contains("Right", doc, n))
346             config_dock_floating = FALSE,
347             config_dock_pos = OB_DIRECTION_EAST;
348         else if (parse_contains("BottomRight", doc, n))
349             config_dock_floating = FALSE,
350             config_dock_pos = OB_DIRECTION_SOUTHEAST;
351         else if (parse_contains("Bottom", doc, n))
352             config_dock_floating = FALSE,
353             config_dock_pos = OB_DIRECTION_SOUTH;
354         else if (parse_contains("BottomLeft", doc, n))
355             config_dock_floating = FALSE,
356             config_dock_pos = OB_DIRECTION_SOUTHWEST;
357         else if (parse_contains("Left", doc, n))
358             config_dock_floating = FALSE,
359             config_dock_pos = OB_DIRECTION_WEST;
360         else if (parse_contains("Floating", doc, n))
361             config_dock_floating = TRUE;
362     }
363     if (config_dock_floating) {
364         if ((n = parse_find_node("floatingX", node)))
365             config_dock_x = parse_int(doc, n);
366         if ((n = parse_find_node("floatingY", node)))
367             config_dock_y = parse_int(doc, n);
368     } else {
369         if ((n = parse_find_node("noStrut", node)))
370             config_dock_nostrut = parse_bool(doc, n);
371     }
372     if ((n = parse_find_node("stacking", node))) {
373         if (parse_contains("top", doc, n))
374             config_dock_layer = OB_STACKING_LAYER_ABOVE;
375         else if (parse_contains("normal", doc, n))
376             config_dock_layer = OB_STACKING_LAYER_NORMAL;
377         else if (parse_contains("bottom", doc, n))
378             config_dock_layer = OB_STACKING_LAYER_BELOW;
379     }
380     if ((n = parse_find_node("direction", node))) {
381         if (parse_contains("horizontal", doc, n))
382             config_dock_orient = OB_ORIENTATION_HORZ;
383         else if (parse_contains("vertical", doc, n))
384             config_dock_orient = OB_ORIENTATION_VERT;
385     }
386     if ((n = parse_find_node("autoHide", node)))
387         config_dock_hide = parse_bool(doc, n);
388     if ((n = parse_find_node("hideDelay", node)))
389         config_dock_hide_delay = parse_int(doc, n) * 1000;
390     if ((n = parse_find_node("moveButton", node))) {
391         gchar *str = parse_string(doc, n);
392         guint b, s;
393         if (translate_button(str, &s, &b)) {
394             config_dock_app_move_button = b;
395             config_dock_app_move_modifiers = s;
396         } else {
397             g_warning("invalid button '%s'", str);
398         }
399         g_free(str);
400     }
401 }
402
403 static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
404                        gpointer d)
405 {
406     xmlNodePtr n;
407     for (node = node->children; node; node = node->next) {
408         if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) {
409             gchar *c;
410
411             c = parse_string(doc, node);
412             config_menu_files = g_slist_append(config_menu_files,
413                                                parse_expand_tilde(c));
414             g_free(c);
415         }
416         if ((n = parse_find_node("warpPointer", node)))
417             config_menu_warppointer = parse_bool(doc, n);
418         if ((n = parse_find_node("xorStyle", node)))
419             config_menu_xorstyle = parse_bool(doc, n);
420         if ((n = parse_find_node("hideDelay", node)))
421             config_menu_hide_delay = parse_int(doc, n);
422         if ((n = parse_find_node("desktopMenuIcons", node)))
423             config_menu_client_list_icons = parse_bool(doc, n);
424     }
425 }
426    
427 static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, 
428                              gpointer d)
429 {
430     xmlNodePtr n;
431
432     node = node->children;
433     if ((n = parse_find_node("strength", node)))
434         config_resist_win = parse_int(doc, n);
435     if ((n = parse_find_node("screen_edge_strength", node)))
436         config_resist_edge = parse_int(doc, n);
437     if ((n = parse_find_node("edges_hit_layers_below", node)))
438         config_resist_layers_below = parse_bool(doc, n);
439 }
440
441 typedef struct
442 {
443     const gchar *key;
444     const gchar *actname;
445 } ObDefKeyBind;
446
447 static void bind_default_keyboard()
448 {
449     ObDefKeyBind *it;
450     ObDefKeyBind binds[] = {
451         { "A-Tab", "NextWindow" },
452         { "S-A-Tab", "PreviousWindow" },
453         { "A-F4", "Close" },
454         { NULL, NULL }
455     };
456
457     for (it = binds; it->key; ++it) {
458         GList *l = g_list_append(NULL, g_strdup(it->key));
459         keyboard_bind(l, action_from_string(it->actname,
460                                             OB_USER_ACTION_KEYBOARD_KEY));
461     }
462 }
463
464 typedef struct
465 {
466     const gchar *button;
467     const gchar *context;
468     const ObMouseAction mact;
469     const gchar *actname;
470 } ObDefMouseBind;
471
472 static void bind_default_mouse()
473 {
474     ObDefMouseBind *it;
475     ObDefMouseBind binds[] = {
476         { "Left", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
477         { "Middle", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
478         { "Right", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
479         { "Left", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
480         { "Middle", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
481         { "Right", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
482         { "Left", "Titlebar", OB_MOUSE_ACTION_PRESS, "Focus" },
483         { "Left", "Handle", OB_MOUSE_ACTION_PRESS, "Focus" },
484         { "Left", "BLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
485         { "Left", "BRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
486         { "Left", "TLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
487         { "Left", "TRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
488         { "Left", "Close", OB_MOUSE_ACTION_PRESS, "Focus" },
489         { "Left", "Maximize", OB_MOUSE_ACTION_PRESS, "Focus" },
490         { "Left", "Iconify", OB_MOUSE_ACTION_PRESS, "Focus" },
491         { "Left", "Icon", OB_MOUSE_ACTION_PRESS, "Focus" },
492         { "Left", "AllDesktops", OB_MOUSE_ACTION_PRESS, "Focus" },
493         { "Left", "Shade", OB_MOUSE_ACTION_PRESS, "Focus" },
494         { "Left", "Client", OB_MOUSE_ACTION_CLICK, "Raise" },
495         { "Left", "Titlebar", OB_MOUSE_ACTION_CLICK, "Raise" },
496         { "Middle", "Titlebar", OB_MOUSE_ACTION_CLICK, "Lower" },
497         { "Left", "Handle", OB_MOUSE_ACTION_CLICK, "Raise" },
498         { "Left", "BLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
499         { "Left", "BRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
500         { "Left", "TLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
501         { "Left", "TRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
502         { "Left", "Close", OB_MOUSE_ACTION_CLICK, "Raise" },
503         { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "Raise" },
504         { "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Raise" },
505         { "Left", "Icon", OB_MOUSE_ACTION_CLICK, "Raise" },
506         { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "Raise" },
507         { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "Raise" },
508         { "Left", "Close", OB_MOUSE_ACTION_CLICK, "Close" },
509         { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "ToggleMaximizeFull" },
510         { "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Iconify" },
511         { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "ToggleOmnipresent" },
512         { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "ToggleShade" },
513         { "Left", "TLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
514         { "Left", "TRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
515         { "Left", "BLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
516         { "Left", "BRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
517         { "Left", "Titlebar", OB_MOUSE_ACTION_MOTION, "Move" },
518         { "A-Left", "Frame", OB_MOUSE_ACTION_MOTION, "Move" },
519         { "A-Middle", "Frame", OB_MOUSE_ACTION_MOTION, "Resize" },
520         { NULL, NULL, 0, NULL }
521     };
522
523     for (it = binds; it->button; ++it) {
524         ObUserAction uact;
525         switch (it->mact) {
526         case OB_MOUSE_ACTION_PRESS:
527             uact = OB_USER_ACTION_MOUSE_PRESS; break;
528         case OB_MOUSE_ACTION_RELEASE:
529             uact = OB_USER_ACTION_MOUSE_RELEASE; break;
530         case OB_MOUSE_ACTION_CLICK:
531             uact = OB_USER_ACTION_MOUSE_CLICK; break;
532         case OB_MOUSE_ACTION_DOUBLE_CLICK:
533             uact = OB_USER_ACTION_MOUSE_DOUBLE_CLICK; break;
534         case OB_MOUSE_ACTION_MOTION:
535             uact = OB_USER_ACTION_MOUSE_MOTION; break;
536         case OB_NUM_MOUSE_ACTIONS:
537             g_assert_not_reached();
538         }
539         mouse_bind(it->button, it->context, it->mact,
540                    action_from_string(it->actname, uact));
541     }
542 }
543
544 void config_startup(ObParseInst *i)
545 {
546     config_focus_new = TRUE;
547     config_focus_follow = FALSE;
548     config_focus_delay = 0;
549     config_focus_raise = FALSE;
550     config_focus_last = FALSE;
551
552     parse_register(i, "focus", parse_focus, NULL);
553
554     config_place_policy = OB_PLACE_POLICY_SMART;
555
556     parse_register(i, "placement", parse_placement, NULL);
557
558     config_theme = NULL;
559
560     config_title_layout = g_strdup("NLIMC");
561     config_theme_keepborder = TRUE;
562     config_theme_hidedisabled = FALSE;
563
564     parse_register(i, "theme", parse_theme, NULL);
565
566     config_desktops_num = 4;
567     config_screen_firstdesk = 1;
568     config_desktops_names = NULL;
569
570     parse_register(i, "desktops", parse_desktops, NULL);
571
572     config_resize_redraw = TRUE;
573     config_resize_four_corners = FALSE;
574     config_resize_popup_show = 1; /* nonpixel increments */
575     config_resize_popup_pos = 0;  /* center of client */
576
577     parse_register(i, "resize", parse_resize, NULL);
578
579     config_dock_layer = OB_STACKING_LAYER_ABOVE;
580     config_dock_pos = OB_DIRECTION_NORTHEAST;
581     config_dock_floating = FALSE;
582     config_dock_nostrut = FALSE;
583     config_dock_x = 0;
584     config_dock_y = 0;
585     config_dock_orient = OB_ORIENTATION_VERT;
586     config_dock_hide = FALSE;
587     config_dock_hide_delay = 300;
588     config_dock_app_move_button = 2; /* middle */
589     config_dock_app_move_modifiers = 0;
590
591     parse_register(i, "dock", parse_dock, NULL);
592
593     translate_key("C-g", &config_keyboard_reset_state,
594                   &config_keyboard_reset_keycode);
595
596     bind_default_keyboard();
597
598     parse_register(i, "keyboard", parse_keyboard, NULL);
599
600     config_mouse_threshold = 3;
601     config_mouse_dclicktime = 200;
602
603     bind_default_mouse();
604
605     parse_register(i, "mouse", parse_mouse, NULL);
606
607     config_resist_win = 10;
608     config_resist_edge = 20;
609     config_resist_layers_below = FALSE;
610
611     parse_register(i, "resistance", parse_resistance, NULL);
612
613     config_menu_warppointer = TRUE;
614     config_menu_xorstyle = TRUE;
615     config_menu_hide_delay = 250;
616     config_menu_client_list_icons = TRUE;
617     config_menu_files = NULL;
618
619     parse_register(i, "menu", parse_menu, NULL);
620 }
621
622 void config_shutdown()
623 {
624     GSList *it;
625
626     g_free(config_theme);
627
628     g_free(config_title_layout);
629
630     for (it = config_desktops_names; it; it = g_slist_next(it))
631         g_free(it->data);
632     g_slist_free(config_desktops_names);
633
634     for (it = config_menu_files; it; it = g_slist_next(it))
635         g_free(it->data);
636     g_slist_free(config_menu_files);
637 }