X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=inline;f=openbox%2Fconfig.c;h=6a45005d81f31d6b6fb11099a62d2fcf23e50ea3;hb=3d7c2f45ec846a487aa5c717de501b11ea9071b2;hp=f18b77c9aa38618f1dac36bc844dbf8c728ef9ef;hpb=6cd5f7ea380e155dbd7b29f01dd3fcfb5858ad61;p=chaz%2Fopenbox
diff --git a/openbox/config.c b/openbox/config.c
index f18b77c9..6a45005d 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -38,7 +38,6 @@ ObPlacePolicy config_place_policy;
gchar *config_theme;
gboolean config_theme_keepborder;
-gboolean config_theme_hidedisabled;
gchar *config_title_layout;
@@ -88,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;
@@ -102,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 center
1
- 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)
@@ -176,7 +175,7 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
}
if (x_pos_given && (c = parse_find_node("y", n->children)))
- if (!parse_contains("default", doc, )) {
+ if (!parse_contains("default", doc, c)) {
gchar *s = parse_string(doc, c);
if (!strcmp(s, "center")) {
settings->center_y = TRUE;
@@ -189,13 +188,13 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
}
if (settings->pos_given &&
- (c = parse_find_node("head", n->children)))
- if (!parse_contains("default", doc, n)) {
- gchar *s = parse_string(doc, n);
+ (c = parse_find_node("monitor", n->children)))
+ if (!parse_contains("default", doc, c)) {
+ gchar *s = parse_string(doc, c);
if (!strcmp(s, "mouse"))
- settings->head = -1;
+ settings->monitor = 0;
else
- settings->head = parse_int(doc, n);
+ settings->monitor = parse_int(doc, c) + 1;
g_free(s);
}
}
@@ -205,61 +204,70 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
if (!parse_contains("default", doc, n))
settings->focus = parse_bool(doc, n);
- if ((n = parse_find_node("desktop", app->children)))
+ if ((n = parse_find_node("desktop", app->children))) {
if (!parse_contains("default", doc, n)) {
gchar *s = parse_string(doc, n);
if (!strcmp(s, "all"))
settings->desktop = DESKTOP_ALL;
- else
- settings->desktop = parse_int(doc, n);
+ else {
+ gint i = parse_int(doc, n);
+ if (i > 0)
+ settings->desktop = i;
+ }
g_free(s);
} else
- /* lets hope the user doesn't have 2^32 desktops */
- settings->desktop = DESKTOP_ALL - 1;
+ 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);
@@ -456,13 +464,18 @@ 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);
@@ -691,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
@@ -737,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" },
@@ -751,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" },
@@ -817,7 +827,6 @@ void config_startup(ObParseInst *i)
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;
@@ -870,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);