summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-12-21 10:13:51 +0000
committersabetts <sabetts>2001-12-21 10:13:51 +0000
commit23f9dc31a7bba68e275c0a00775f59bc04e0bb18 (patch)
treed35d2894efa7bcf64921aa8a3d60f2e5e4cedde1 /src
parent2a67d86985a3d67d707d7d6c46a3b7e5b7d11435 (diff)
downloadratpoison-23f9dc31a7bba68e275c0a00775f59bc04e0bb18.zip
* src/input.c (update_input_window): Draw the cursor in the right place.
* src/actions.h (cmd_defbarpadding): new prototype * src/actions.c (user_commands): new command entry "defbarpadding" (cmd_defbarpadding): new function
Diffstat (limited to 'src')
-rw-r--r--src/actions.c24
-rw-r--r--src/actions.h1
-rw-r--r--src/input.c4
3 files changed, 27 insertions, 2 deletions
diff --git a/src/actions.c b/src/actions.c
index acc6398..48e9179 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -97,6 +97,7 @@ static user_command user_commands[] =
{"defwingravity", cmd_defwingravity, arg_STRING},
{"deffgcolor", cmd_deffgcolor, arg_STRING},
{"defbgcolor", cmd_defbgcolor, arg_STRING},
+ {"defbarpadding", cmd_defbarpadding, arg_STRING},
/* Commands to help debug ratpoison. */
#ifdef DEBUG
@@ -2040,3 +2041,26 @@ cmd_link (int interactive, void *data)
return NULL;
}
+
+char *
+cmd_defbarpadding (int interactive, void *data)
+{
+ int x, y;
+
+ if (data == NULL || sscanf (data, "%d %d", &x, &y) < 2)
+ {
+ message (" defbarpadding: Two arguments required ");
+ return NULL;
+ }
+
+ if (x >= 0 && y >= 0)
+ {
+ defaults.bar_x_padding = x;
+ defaults.bar_y_padding = y;
+ }
+ else
+ {
+ message (" defbarpadding: Bad argument ");
+ }
+ return NULL;
+}
diff --git a/src/actions.h b/src/actions.h
index 0e6fb56..f285e4f 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -104,6 +104,7 @@ char * cmd_restart (int interactive, void *data);
char * cmd_startup_message (int interactive, void *data);
char * cmd_focuslast (int interactive, void *data);
char * cmd_link (int interactive, void *data);
+char * cmd_defbarpadding (int interactive, void *data);
/* void cmd_xterm (void *data); */
diff --git a/src/input.c b/src/input.c
index 9c6c14b..27d7583 100644
--- a/src/input.c
+++ b/src/input.c
@@ -295,9 +295,9 @@ update_input_window (screen_info *s, char *prompt, char *input, int input_len)
/* Draw a cheap-o cursor. */
XDrawLine (dpy, s->input_window, s->normal_gc,
- defaults.bar_x_padding * 2 + prompt_width + input_width + 2,
+ defaults.bar_x_padding + prompt_width + input_width + 2,
defaults.bar_y_padding + 1,
- defaults.bar_x_padding * 2 + prompt_width + input_width + 2,
+ defaults.bar_x_padding + prompt_width + input_width + 2,
defaults.bar_y_padding + FONT_HEIGHT (defaults.font) - 1);
}