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