X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fconfig.c;h=6a45005d81f31d6b6fb11099a62d2fcf23e50ea3;hb=8159ac5f8634ccaf7cd34e12ea1efa457e4bdcac;hp=f8b3fd95449bd1de7bb68fc8de76bde8f04e27ce;hpb=baa9ad14803fd3019f8da364439dafe9c0e1a9f7;p=chaz%2Fopenbox
diff --git a/openbox/config.c b/openbox/config.c
index f8b3fd95..6a45005d 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -38,14 +38,16 @@ ObPlacePolicy config_place_policy;
gchar *config_theme;
gboolean config_theme_keepborder;
-gboolean config_theme_hidedisabled;
gchar *config_title_layout;
+gboolean config_animate_iconify;
+
RrFont *config_font_activewindow;
RrFont *config_font_inactivewindow;
RrFont *config_font_menuitem;
RrFont *config_font_menutitle;
+RrFont *config_font_osd;
gint config_desktops_num;
GSList *config_desktops_names;
@@ -85,7 +87,6 @@ GSList *config_menu_files;
gint config_resist_win;
gint config_resist_edge;
-gboolean config_resist_layers_below;
GSList *config_per_app_settings;
@@ -99,22 +100,23 @@ GSList *config_per_app_settings;
700
0
+ 1
-
1
+ .. there is a lot more settings available
*/
/* Manages settings for individual applications.
- Some notes: head is the screen number in a multi monitor
+ Some notes: monitor is the screen number in a multi monitor
(Xinerama) setup (starting from 0) or mouse, meaning the
- head the pointer is on. Default: mouse.
+ monitor the pointer is on. Default: mouse.
Layer can be three values, above (Always on top), below
(Always on bottom) and everything else (normal behaviour).
Positions can be an integer value or center, which will
- center the window in the specified axis. Position is relative
- from head, so center1
- will center the window on the second head.
+ center the window in the specified axis. Position is within
+ the monitor, so center2
+ will center the window on the second monitor.
*/
static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
xmlNodePtr node, gpointer d)
@@ -148,108 +150,124 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
settings->decor = -1;
if ((n = parse_find_node("decor", app->children)))
- settings->decor = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->decor = parse_bool(doc, n);
settings->shade = -1;
if ((n = parse_find_node("shade", app->children)))
- settings->shade = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->shade = parse_bool(doc, n);
settings->position.x = settings->position.y = 0;
settings->pos_given = FALSE;
if ((n = parse_find_node("position", app->children))) {
- if ((c = parse_find_node("x", n->children))) {
- gchar *s = parse_string(doc, c);
- if (!strcmp(s, "center")) {
- settings->center_x = TRUE;
- x_pos_given = TRUE;
- } else {
- settings->position.x = parse_int(doc, c);
- x_pos_given = TRUE;
+ if ((c = parse_find_node("x", n->children)))
+ if (!parse_contains("default", doc, c)) {
+ gchar *s = parse_string(doc, c);
+ if (!strcmp(s, "center")) {
+ settings->center_x = TRUE;
+ x_pos_given = TRUE;
+ } else {
+ settings->position.x = parse_int(doc, c);
+ x_pos_given = TRUE;
+ }
+ g_free(s);
}
- g_free(s);
- }
- if (x_pos_given && (c = parse_find_node("y", n->children))) {
- gchar *s = parse_string(doc, c);
- if (!strcmp(s, "center")) {
- settings->center_y = TRUE;
- settings->pos_given = TRUE;
- } else {
- settings->position.y = parse_int(doc, c);
- settings->pos_given = TRUE;
+ if (x_pos_given && (c = parse_find_node("y", n->children)))
+ if (!parse_contains("default", doc, c)) {
+ gchar *s = parse_string(doc, c);
+ if (!strcmp(s, "center")) {
+ settings->center_y = TRUE;
+ settings->pos_given = TRUE;
+ } else {
+ settings->position.y = parse_int(doc, c);
+ settings->pos_given = TRUE;
+ }
+ g_free(s);
+ }
+
+ if (settings->pos_given &&
+ (c = parse_find_node("monitor", n->children)))
+ if (!parse_contains("default", doc, c)) {
+ gchar *s = parse_string(doc, c);
+ if (!strcmp(s, "mouse"))
+ settings->monitor = 0;
+ else
+ settings->monitor = parse_int(doc, c) + 1;
+ g_free(s);
}
- g_free(s);
- }
}
settings->focus = -1;
if ((n = parse_find_node("focus", app->children)))
- settings->focus = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->focus = parse_bool(doc, n);
if ((n = parse_find_node("desktop", app->children))) {
- gchar *s = parse_string(doc, n);
- if (!strcmp(s, "all"))
- settings->desktop = DESKTOP_ALL;
- else
- settings->desktop = parse_int(doc, n);
- g_free(s);
- } else
- settings->desktop = DESKTOP_ALL - 1; /* lets hope the user
- * doesn't have 2^32
- * desktops */
-
- if ((n = parse_find_node("head", app->children))) {
- gchar *s = parse_string(doc, n);
- if (!strcmp(s, "mouse"))
- settings->head = -1;
- else
- settings->head = parse_int(doc, n);
- g_free(s);
+ if (!parse_contains("default", doc, n)) {
+ gchar *s = parse_string(doc, n);
+ if (!strcmp(s, "all"))
+ settings->desktop = DESKTOP_ALL;
+ else {
+ gint i = parse_int(doc, n);
+ if (i > 0)
+ settings->desktop = i;
+ }
+ g_free(s);
+ } else
+ settings->desktop = 0;
}
settings->layer = -2;
- if ((n = parse_find_node("layer", app->children))) {
- gchar *s = parse_string(doc, n);
- if (!strcmp(s, "above"))
- settings->layer = 1;
- else if (!strcmp(s, "below"))
- settings->layer = -1;
- else
- settings->layer = 0;
- g_free(s);
- }
+ if ((n = parse_find_node("layer", app->children)))
+ if (!parse_contains("default", doc, n)) {
+ gchar *s = parse_string(doc, n);
+ if (!strcmp(s, "above"))
+ settings->layer = 1;
+ else if (!strcmp(s, "below"))
+ settings->layer = -1;
+ else
+ settings->layer = 0;
+ g_free(s);
+ }
settings->iconic = -1;
if ((n = parse_find_node("iconic", app->children)))
- settings->iconic = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->iconic = parse_bool(doc, n);
settings->skip_pager = -1;
if ((n = parse_find_node("skip_pager", app->children)))
- settings->skip_pager = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->skip_pager = parse_bool(doc, n);
settings->skip_taskbar = -1;
if ((n = parse_find_node("skip_taskbar", app->children)))
- settings->skip_taskbar = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->skip_taskbar = parse_bool(doc, n);
settings->fullscreen = -1;
if ((n = parse_find_node("fullscreen", app->children)))
- settings->fullscreen = parse_bool(doc, n);
+ if (!parse_contains("default", doc, n))
+ settings->fullscreen = parse_bool(doc, n);
settings->max_horz = -1;
settings->max_vert = -1;
- if ((n = parse_find_node("maximized", app->children))) {
- gchar *s = parse_string(doc, n);
- if (!strcmp(s, "horizontal")) {
- settings->max_horz = TRUE;
- settings->max_vert = FALSE;
- } else if (!strcmp(s, "vertical")) {
- settings->max_horz = FALSE;
- settings->max_vert = TRUE;
- } else
- settings->max_horz = settings->max_vert =
- parse_bool(doc, n);
- g_free(s);
- }
+ if ((n = parse_find_node("maximized", app->children)))
+ if (!parse_contains("default", doc, n)) {
+ gchar *s = parse_string(doc, n);
+ if (!strcmp(s, "horizontal")) {
+ settings->max_horz = TRUE;
+ settings->max_vert = FALSE;
+ } else if (!strcmp(s, "vertical")) {
+ settings->max_horz = FALSE;
+ settings->max_vert = TRUE;
+ } else
+ settings->max_horz = settings->max_vert =
+ parse_bool(doc, n);
+ g_free(s);
+ }
config_per_app_settings = g_slist_append(config_per_app_settings,
(gpointer) settings);
@@ -446,13 +464,20 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
g_free(c);
}
if ((n = parse_find_node("titleLayout", node))) {
+ gchar *c, *d;
+
g_free(config_title_layout);
config_title_layout = parse_string(doc, n);
+
+ /* replace duplicates with spaces */
+ for (c = config_title_layout; *c != '\0'; ++c)
+ for (d = c+1; *d != '\0'; ++d)
+ if (*c == *d) *d = ' ';
}
if ((n = parse_find_node("keepBorder", node)))
config_theme_keepborder = parse_bool(doc, n);
- if ((n = parse_find_node("hideDisabled", node)))
- config_theme_hidedisabled = parse_bool(doc, n);
+ if ((n = parse_find_node("animateIconify", node)))
+ config_animate_iconify = parse_bool(doc, n);
n = parse_find_node("font", node);
while (n) {
@@ -467,10 +492,12 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
font = &config_font_activewindow;
else if (parse_attr_contains("InactiveWindow", n, "place"))
font = &config_font_inactivewindow;
- else if (parse_attr_contains("MenuTitle", n, "place"))
+ else if (parse_attr_contains("MenuHeader", n, "place"))
font = &config_font_menutitle;
else if (parse_attr_contains("MenuItem", n, "place"))
font = &config_font_menuitem;
+ else if (parse_attr_contains("OnScreenDisplay", n, "place"))
+ font = &config_font_osd;
else
goto next_font;
@@ -656,15 +683,13 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
parse_expand_tilde(c));
g_free(c);
}
- if ((n = parse_find_node("warpPointer", node)))
- config_menu_warppointer = parse_bool(doc, n);
if ((n = parse_find_node("hideDelay", node)))
config_menu_hide_delay = parse_int(doc, n);
if ((n = parse_find_node("middle", node)))
config_menu_middle = parse_bool(doc, n);
if ((n = parse_find_node("submenuShowDelay", node)))
config_submenu_show_delay = parse_int(doc, n);
- if ((n = parse_find_node("desktopMenuIcons", node)))
+ if ((n = parse_find_node("applicationIcons", node)))
config_menu_client_list_icons = parse_bool(doc, n);
}
}
@@ -679,8 +704,6 @@ static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
config_resist_win = parse_int(doc, n);
if ((n = parse_find_node("screen_edge_strength", node)))
config_resist_edge = parse_int(doc, n);
- if ((n = parse_find_node("edges_hit_layers_below", node)))
- config_resist_layers_below = parse_bool(doc, n);
}
typedef struct
@@ -725,7 +748,7 @@ static void bind_default_mouse()
{ "Middle", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
{ "Right", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
{ "Left", "Titlebar", OB_MOUSE_ACTION_PRESS, "Focus" },
- { "Left", "Handle", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Bottom", OB_MOUSE_ACTION_PRESS, "Focus" },
{ "Left", "BLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
{ "Left", "BRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
{ "Left", "TLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
@@ -739,7 +762,6 @@ static void bind_default_mouse()
{ "Left", "Client", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "Titlebar", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Middle", "Titlebar", OB_MOUSE_ACTION_CLICK, "Lower" },
- { "Left", "Handle", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "BLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "BRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "TLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
@@ -802,9 +824,9 @@ void config_startup(ObParseInst *i)
config_theme = NULL;
+ config_animate_iconify = TRUE;
config_title_layout = g_strdup("NLIMC");
config_theme_keepborder = TRUE;
- config_theme_hidedisabled = FALSE;
config_font_activewindow = NULL;
config_font_inactivewindow = NULL;
@@ -857,7 +879,6 @@ void config_startup(ObParseInst *i)
config_resist_win = 10;
config_resist_edge = 20;
- config_resist_layers_below = FALSE;
parse_register(i, "resistance", parse_resistance, NULL);