summaryrefslogtreecommitdiff
path: root/openbox/config.c
diff options
context:
space:
mode:
authorIan Zimmerman <itz@buug.org>2013-08-17 16:08:25 -0700
committerDana Jansens <danakj@orodu.net>2013-09-01 15:09:03 -0400
commitf866c034bf6e954791442ff029d5ae51ab0bd616 (patch)
tree3794c466a8dc2a62d2bcf8ba6f4a07e2070c81af /openbox/config.c
parent9750e5cea8d8cdab2b8b988a8c5d6392b0dbeae8 (diff)
Add the old <center> option for the placement policy. (Bug 5946)
Original commit messages: . Reformat to move closer to house style . Add center on top of leat overlap place algo . Add sentinel value to edge arrays . Use a Size instead of a Rect for a centering field . Fix off by one bug . Need to declare dx and dy . Pass length of edge array instead of recomputing . Fix missing open-brace in config.c . Address the more trivial subset of danakj comments . Revert "Remove now-unused config_place_center option." This reverts commit 5e282dae08be3b900e0337efa0fae8f3ffa92cd7. . Remove reliance on sentinel value when scanning edge arrays . Avoid need to initialize Size structure by removing it :) . Clean up field expansion code somewhat . Compress code further by using a structure for common args . Fix search for next grid point . Squeeze it even more by not using Size at all
Diffstat (limited to 'openbox/config.c')
-rw-r--r--openbox/config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbox/config.c b/openbox/config.c
index 8e1bcf89..76f48569 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -37,6 +37,7 @@ gboolean config_focus_under_mouse;
gboolean config_unfocus_leave;
ObPlacePolicy config_place_policy;
+gboolean config_place_center;
ObPlaceMonitor config_place_monitor;
guint config_primary_monitor_index;
@@ -625,9 +626,13 @@ static void parse_placement(xmlNodePtr node, gpointer d)
node = node->children;
- if ((n = obt_xml_find_node(node, "policy")))
+ if ((n = obt_xml_find_node(node, "policy"))) {
if (obt_xml_node_contains(n, "UnderMouse"))
config_place_policy = OB_PLACE_POLICY_MOUSE;
+ }
+ if ((n = obt_xml_find_node(node, "center"))) {
+ config_place_center = obt_xml_node_bool(n);
+ }
if ((n = obt_xml_find_node(node, "monitor"))) {
if (obt_xml_node_contains(n, "active"))
config_place_monitor = OB_PLACE_MONITOR_ACTIVE;
@@ -1055,6 +1060,7 @@ void config_startup(ObtXmlInst *i)
obt_xml_register(i, "focus", parse_focus, NULL);
config_place_policy = OB_PLACE_POLICY_SMART;
+ config_place_center = TRUE;
config_place_monitor = OB_PLACE_MONITOR_PRIMARY;
config_primary_monitor_index = 1;