bar/xcb: ignore non-zero border margins

This commit is contained in:
Daniel Eklöf 2019-02-17 19:45:26 +01:00
parent 0ab772f869
commit 28d39f3aec
3 changed files with 14 additions and 5 deletions

View file

@ -111,11 +111,11 @@ There are a couple types used that are specific to f00bar.
| border | dict | no | Configures a border around the status bar | border | dict | no | Configures a border around the status bar
| border.width | int | no | Width, in pixels, of the border | border.width | int | no | Width, in pixels, of the border
| border.color | color | no | The color of the border | border.color | color | no | The color of the border
| border.margin | int | no | left/rigth/top/bottom margins, from screen edge to bar | border.margin | int | no | left/rigth/top/bottom margins, from screen edge to bar. _Wayland only_
| border.left-margin | int | no | left margin from screen edge to bar. Overrides `border.margin` | border.left-margin | int | no | left margin from screen edge to bar. Overrides `border.margin`. _Wayland only_
| border.right-margin | int | no | right margin from screen edge to bar. Overrides `border.margin` | border.right-margin | int | no | right margin from screen edge to bar. Overrides `border.margin`. _Wayland only_
| border.top-margin | int | no | top margin from screen edge to bar. Overrides `border.margin` | border.top-margin | int | no | top margin from screen edge to bar. Overrides `border.margin`. _Wayland only_
| border.bottom-margin | int | no | bottom margin from screen edge to bar. Overrides `border.margin` | border.bottom-margin | int | no | bottom margin from screen edge to bar. Overrides `border.margin`. _Wayland only_
| font | font | no | Default font to use in modules and particles | font | font | no | Default font to use in modules and particles
| foreground | color | no | Default foreground (text) color to use | foreground | color | no | Default foreground (text) color to use
| left | list | no | Left-aligned modules | left | list | no | Left-aligned modules

View file

@ -656,6 +656,7 @@ setup(struct bar *_bar)
return false; return false;
} }
assert(backend->width <= backend->monitor->width_px);
bar->width = backend->width; bar->width = backend->width;
if (pipe(backend->pipe_fds) == -1) { if (pipe(backend->pipe_fds) == -1) {

View file

@ -46,6 +46,14 @@ setup(struct bar *_bar)
struct private *bar = _bar->private; struct private *bar = _bar->private;
struct xcb_backend *backend = bar->backend.data; struct xcb_backend *backend = bar->backend.data;
if (bar->border.left_margin != 0 ||
bar->border.right_margin != 0 ||
bar->border.top_margin != 0 ||
bar->border.bottom_margin)
{
LOG_WARN("non-zero border margins ignored in X11 backend");
}
/* TODO: a lot of this (up to mapping the window) could be done in bar_new() */ /* TODO: a lot of this (up to mapping the window) could be done in bar_new() */
xcb_generic_error_t *e; xcb_generic_error_t *e;