summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2002-01-24 22:17:50 +0000
committersabetts <sabetts>2002-01-24 22:17:50 +0000
commit358f741058879d91b501df1d8eb336df6897c55a (patch)
treeee283e9c8d244ec816d7860baac196e194661ead /src
parent61432f3c09711bf6690af0d851a5fda92c009153 (diff)
downloadratpoison-358f741058879d91b501df1d8eb336df6897c55a.zip
* src/actions.c (cmd_defbarloc): Read the location argument as a
gravity argument using parse_wingravity.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/actions.c b/src/actions.c
index b790557..db73111 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1702,30 +1702,29 @@ cmd_defbarloc (int interactive, void *data)
if (data == NULL && !interactive)
return xstrdup (wingravity_to_string (defaults.bar_location));
- if (data == NULL
- || sscanf (data, "%d", &loc) < 1)
+ if (data == NULL)
{
message (" defbarloc: One argument required ");
return NULL;
}
+ if ((loc = parse_wingravity (data)) < 0)
+ {
+ message (" defbarloc: Bad location ");
+ return NULL;
+ }
+
switch (loc)
{
- case 0:
- defaults.bar_location = NorthWestGravity;
- break;
- case 1:
- defaults.bar_location = NorthEastGravity;
- break;
- case 2:
- defaults.bar_location = SouthEastGravity;
- break;
- case 3:
- defaults.bar_location = SouthWestGravity;
+ case NorthWestGravity:
+ case NorthEastGravity:
+ case SouthWestGravity:
+ case SouthEastGravity:
+ defaults.bar_location = loc;
break;
default:
- message (" defbarloc: Unknown location ");
+ message (" defbarloc: Bad location ");
break;
}
@@ -1892,7 +1891,7 @@ cmd_defbarborder (int interactive, void *data)
int i;
if (data == NULL && !interactive)
- return xsprintf ("%d", defaults.window_border_width);
+ return xsprintf ("%d", defaults.bar_border_width);
if (data == NULL
|| sscanf (data, "%d", &tmp) < 1)