diff -Naur --exclude tags ratpoison/doc/ratpoison.texi ratpoison.defbarborder/doc/ratpoison.texi --- ratpoison/doc/ratpoison.texi Thu Jan 17 20:02:37 2002 +++ ratpoison.defbarborder/doc/ratpoison.texi Fri Jan 25 00:58:32 2002 @@ -380,6 +380,12 @@ @item curframe Indicate which frame is the current frame. address@hidden defbarborder @var{n} +Set the border width for the bar. + +When called non-interactively with no arguments, the current setting is +returned. + @item defbarloc @var{n} Set the message bar location. @var{n} is a value between 0 and 3. 0 is the top left and the values move clockwise around the screen to the diff -Naur --exclude tags ratpoison/src/actions.c ratpoison.defbarborder/src/actions.c --- ratpoison/src/actions.c Thu Jan 24 11:18:12 2002 +++ ratpoison.defbarborder/src/actions.c Fri Jan 25 00:56:34 2002 @@ -100,6 +100,7 @@ {"deffgcolor", cmd_deffgcolor, arg_STRING}, {"defbgcolor", cmd_defbgcolor, arg_STRING}, {"defbarpadding", cmd_defbarpadding, arg_STRING}, + {"defbarborder", cmd_defbarborder, arg_STRING}, /* Commands to help debug ratpoison. */ #ifdef DEBUG @@ -1993,7 +1994,7 @@ screens[i].fg_color = color.pixel; update_gc (&screens[i]); XSetWindowBorder (dpy, screens[i].bar_window, color.pixel); - XSetWindowBorder (dpy, screens[i].key_window, color.pixel); + /*XSetWindowBorder (dpy, screens[i].key_window, color.pixel);*/ XSetWindowBorder (dpy, screens[i].input_window, color.pixel); XSetWindowBorder (dpy, screens[i].frame_window, color.pixel); XSetWindowBorder (dpy, screens[i].help_window, color.pixel); @@ -2025,7 +2026,7 @@ screens[i].bg_color = color.pixel; update_gc (&screens[i]); XSetWindowBackground (dpy, screens[i].bar_window, color.pixel); - XSetWindowBackground (dpy, screens[i].key_window, color.pixel); + /*XSetWindowBackground (dpy, screens[i].key_window, color.pixel);*/ XSetWindowBackground (dpy, screens[i].input_window, color.pixel); XSetWindowBackground (dpy, screens[i].frame_window, color.pixel); XSetWindowBackground (dpy, screens[i].help_window, color.pixel); @@ -2392,3 +2393,38 @@ return NULL; } + +char * +cmd_defbarborder (int interactive, void *data) +{ + int tmp, i; + + if (data == NULL) + return xsprintf ("%d", defaults.bar_border_width); + + if (data == NULL + || sscanf (data, "%d", &tmp) < 1) + { + message (" defbarborder: One argument required "); + return NULL; + } + + if (tmp >= 0) + { + defaults.bar_border_width = tmp; + + for (i = 0; i < num_screens; i++) + { + XSetWindowBorderWidth (dpy, screens[i].bar_window, defaults.bar_border_width); + XSetWindowBorderWidth (dpy, screens[i].input_window, defaults.bar_border_width); + XSetWindowBorderWidth (dpy, screens[i].frame_window, defaults.bar_border_width); + } + } + else + { + message (" defbarborder: Bad argument "); + } + + return NULL; +} + diff -Naur --exclude tags ratpoison/src/actions.h ratpoison.defbarborder/src/actions.h --- ratpoison/src/actions.h Fri Dec 21 13:58:01 2001 +++ ratpoison.defbarborder/src/actions.h Thu Jan 24 22:42:56 2002 @@ -107,6 +107,7 @@ char * cmd_defbarpadding (int interactive, void *data); char * cmd_license (int interactive, void *data); char * cmd_alias (int interactive, void *data); +char * cmd_defbarborder (int interactive, void *data); /* void cmd_xterm (void *data); */ diff -Naur --exclude tags ratpoison/src/bar.c ratpoison.defbarborder/src/bar.c --- ratpoison/src/bar.c Fri Dec 21 11:58:56 2001 +++ ratpoison.defbarborder/src/bar.c Thu Jan 24 22:45:47 2002 @@ -84,7 +84,7 @@ { if (defaults.bar_location == SouthEastGravity || defaults.bar_location == NorthEastGravity) - return s->root_attr.width - width - 2; + return s->root_attr.width - width - defaults.bar_border_width * 2; else return 0; } @@ -96,7 +96,7 @@ || defaults.bar_location == NorthEastGravity ) return 0; else - return s->root_attr.height - (FONT_HEIGHT (defaults.font) + defaults.bar_y_padding * 2) - 2; + return s->root_attr.height - (FONT_HEIGHT (defaults.font) + defaults.bar_y_padding * 2) - defaults.bar_border_width * 2; } void diff -Naur --exclude tags ratpoison/src/data.h ratpoison.defbarborder/src/data.h --- ratpoison/src/data.h Fri Dec 21 10:03:54 2001 +++ ratpoison.defbarborder/src/data.h Thu Jan 24 22:46:17 2002 @@ -140,6 +140,7 @@ int bar_y_padding; int bar_location; int bar_timeout; + int bar_border_width; int frame_indicator_timeout; diff -Naur --exclude tags ratpoison/src/main.c ratpoison.defbarborder/src/main.c --- ratpoison/src/main.c Fri Jan 11 10:47:07 2002 +++ ratpoison.defbarborder/src/main.c Fri Jan 25 00:55:38 2002 @@ -412,6 +412,7 @@ defaults.bar_y_padding = 0; defaults.bar_location = NorthEastGravity; defaults.bar_timeout = 5; + defaults.bar_border_width = 1; defaults.frame_indicator_timeout = 1; @@ -619,26 +620,27 @@ /* Create the program bar window. */ s->bar_is_raised = 0; s->bar_window = XCreateSimpleWindow (dpy, s->root, 0, 0, - 1, 1, 1, s->fg_color, s->bg_color); + 1, 1, defaults.bar_border_width, s->fg_color, s->bg_color); /* Setup the window that will recieve all keystrokes once the prefix key has been pressed. */ - s->key_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, 0, WhitePixel (dpy, s->screen_num), BlackPixel (dpy, s->screen_num)); + s->key_window = XCreateSimpleWindow (dpy, s->root, 0, 0, + 1, 1, 0, WhitePixel (dpy, s->screen_num), BlackPixel (dpy, s->screen_num)); XSelectInput (dpy, s->key_window, KeyPressMask ); XMapWindow (dpy, s->key_window); /* Create the input window. */ s->input_window = XCreateSimpleWindow (dpy, s->root, 0, 0, - 1, 1, 1, s->fg_color, s->bg_color); + 1, 1, defaults.bar_border_width, s->fg_color, s->bg_color); XSelectInput (dpy, s->input_window, KeyPressMask ); /* Create the frame indicator window */ - s->frame_window = XCreateSimpleWindow (dpy, s->root, 1, 1, 1, 1, 1, - s->fg_color, s->bg_color); + s->frame_window = XCreateSimpleWindow (dpy, s->root, 1, 1, + 1, 1, defaults.bar_border_width, s->fg_color, s->bg_color); /* Create the help window */ - s->help_window = XCreateSimpleWindow (dpy, s->root, 0, 0, s->root_attr.width, - s->root_attr.height, 1, s->fg_color, s->bg_color); + s->help_window = XCreateSimpleWindow (dpy, s->root, 0, 0, s->root_attr.width - 2, + s->root_attr.height - 2, 1, s->fg_color, s->bg_color); XSelectInput (dpy, s->help_window, KeyPressMask); XSync (dpy, 0);