X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fconfig.c;h=0d28be2cb8d1568f59559249478fee2e89040c68;hb=acafa38c8ea210b12ed92fc16281b915ab61542c;hp=cc86ce7cfa748fbc0da12148485a25ce2f396d05;hpb=c70379fa8f771e499a4d47e84af06d71838b780d;p=chaz%2Fopenbox diff --git a/openbox/config.c b/openbox/config.c index cc86ce7c..0d28be2c 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -22,7 +22,6 @@ #include "mouse.h" #include "actions.h" #include "translate.h" -#include "hooks.h" #include "client.h" #include "screen.h" #include "openbox.h" @@ -40,10 +39,14 @@ ObPlacePolicy config_place_policy; gboolean config_place_center; ObPlaceMonitor config_place_monitor; +guint config_primary_monitor_index; +ObPlaceMonitor config_primary_monitor; + StrutPartial config_margins; gchar *config_theme; gboolean config_theme_keepborder; +guint config_theme_window_list_icon_size; gchar *config_title_layout; @@ -128,6 +131,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, copy_if(type, (ObClientType)-1); copy_if(decor, -1); copy_if(shade, -1); + copy_if(monitor, -1); copy_if(focus, -1); copy_if(desktop, 0); copy_if(layer, -2); @@ -198,7 +202,7 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d) gboolean x_pos_given; while (app) { - name_set = class_set = type_set = x_pos_given = FALSE; + x_pos_given = FALSE; class_set = obt_parse_attr_string(app, "class", &class); name_set = obt_parse_attr_string(app, "name", &name); @@ -263,7 +267,7 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d) if (!g_ascii_strcasecmp(s, "mouse")) settings->monitor = 0; else - settings->monitor = obt_parse_node_int(c) + 1; + settings->monitor = obt_parse_node_int(c); g_free(s); } @@ -343,47 +347,6 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d) } } -static void parse_hook(xmlNodePtr node, gpointer d) -{ - gchar *name; - ObHook hook; - xmlNodePtr n; - - - if (!obt_parse_attr_string(node, "name", &name)) { - g_message(_("Hook in config file is missing a name")); - return; - } - - hook = hooks_hook_from_name(name); - if (!hook) - g_message(_("Unknown hook \"%s\" in config file"), name); - else { - if ((n = obt_parse_find_node(node->children, "action"))) - while (n) { - ObActionsAct *action; - - action = actions_parse(n); - if (action) - hooks_add(hook, action); - n = obt_parse_find_node(n->next, "action"); - } - } - - g_free(name); -} - -static void parse_hooks(xmlNodePtr node, gpointer d) -{ - xmlNodePtr n; - - if ((n = obt_parse_find_node(node->children, "hook"))) - while (n) { - parse_hook(n, NULL); - n = obt_parse_find_node(n->next, "hook"); - } -} - /* @@ -477,8 +440,13 @@ static void parse_mouse(xmlNodePtr node, gpointer d) config_mouse_threshold = obt_parse_node_int(n); if ((n = obt_parse_find_node(node, "doubleClickTime"))) config_mouse_dclicktime = obt_parse_node_int(n); - if ((n = obt_parse_find_node(node, "screenEdgeWarpTime"))) + if ((n = obt_parse_find_node(node, "screenEdgeWarpTime"))) { config_mouse_screenedgetime = obt_parse_node_int(n); + /* minimum value of 25 for this property, when it is 1 and you hit the + edge it basically never stops */ + if (config_mouse_screenedgetime && config_mouse_screenedgetime < 25) + config_mouse_screenedgetime = 25; + } n = obt_parse_find_node(node, "context"); while (n) { @@ -555,6 +523,13 @@ static void parse_placement(xmlNodePtr node, gpointer d) else if (obt_parse_node_contains(n, "mouse")) config_place_monitor = OB_PLACE_MONITOR_MOUSE; } + if ((n = obt_parse_find_node(node, "primaryMonitor"))) { + config_primary_monitor_index = obt_parse_node_int(n); + if (!config_primary_monitor_index) { + if (obt_parse_node_contains(n, "mouse")) + config_primary_monitor = OB_PLACE_MONITOR_MOUSE; + } + } } static void parse_margins(xmlNodePtr node, gpointer d) @@ -602,6 +577,13 @@ static void parse_theme(xmlNodePtr node, gpointer d) config_theme_keepborder = obt_parse_node_bool(n); if ((n = obt_parse_find_node(node, "animateIconify"))) config_animate_iconify = obt_parse_node_bool(n); + if ((n = obt_parse_find_node(node, "windowListIconSize"))) { + config_theme_window_list_icon_size = obt_parse_node_int(n); + if (config_theme_window_list_icon_size < 16) + config_theme_window_list_icon_size = 16; + else if (config_theme_window_list_icon_size > 96) + config_theme_window_list_icon_size = 96; + } n = obt_parse_find_node(node, "font"); while (n) { @@ -815,25 +797,25 @@ static void parse_dock(xmlNodePtr node, gpointer d) static void parse_menu(xmlNodePtr node, gpointer d) { xmlNodePtr n; - for (node = node->children; node; node = node->next) { - if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) { - gchar *c; + node = node->children; - c = obt_parse_node_string(node); + if ((n = obt_parse_find_node(node, "hideDelay"))) + config_menu_hide_delay = obt_parse_node_int(n); + if ((n = obt_parse_find_node(node, "middle"))) + config_menu_middle = obt_parse_node_bool(n); + if ((n = obt_parse_find_node(node, "submenuShowDelay"))) + config_submenu_show_delay = obt_parse_node_int(n); + if ((n = obt_parse_find_node(node, "applicationIcons"))) + config_menu_client_list_icons = obt_parse_node_bool(n); + if ((n = obt_parse_find_node(node, "manageDesktops"))) + config_menu_manage_desktops = obt_parse_node_bool(n); + + while ((node = obt_parse_find_node(node, "file"))) { + gchar *c = obt_parse_node_string(node); config_menu_files = g_slist_append(config_menu_files, obt_paths_expand_tilde(c)); g_free(c); - } - if ((n = obt_parse_find_node(node, "hideDelay"))) - config_menu_hide_delay = obt_parse_node_int(n); - if ((n = obt_parse_find_node(node, "middle"))) - config_menu_middle = obt_parse_node_bool(n); - if ((n = obt_parse_find_node(node, "submenuShowDelay"))) - config_submenu_show_delay = obt_parse_node_int(n); - if ((n = obt_parse_find_node(node, "applicationIcons"))) - config_menu_client_list_icons = obt_parse_node_bool(n); - if ((n = obt_parse_find_node(node, "manageDesktops"))) - config_menu_manage_desktops = obt_parse_node_bool(n); + node = node->next; } } @@ -951,6 +933,9 @@ void config_startup(ObtParseInst *i) config_place_center = TRUE; config_place_monitor = OB_PLACE_MONITOR_ANY; + config_primary_monitor_index = 1; + config_primary_monitor = OB_PLACE_MONITOR_ACTIVE; + obt_parse_register(i, "placement", parse_placement, NULL); STRUT_PARTIAL_SET(config_margins, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); @@ -962,6 +947,7 @@ void config_startup(ObtParseInst *i) config_animate_iconify = TRUE; config_title_layout = g_strdup("NLIMC"); config_theme_keepborder = TRUE; + config_theme_window_list_icon_size = 36; config_font_activewindow = NULL; config_font_inactivewindow = NULL; @@ -1029,8 +1015,6 @@ void config_startup(ObtParseInst *i) obt_parse_register(i, "menu", parse_menu, NULL); - obt_parse_register(i, "hooks", parse_hooks, NULL); - config_per_app_settings = NULL; obt_parse_register(i, "applications", parse_per_app_settings, NULL);