swaybar: separate adjacent borders

This commit decouples the surface height from the usable height, making it
possible to draw a separator between the workspace/mode and window borders
on top (for bottom bars) or bottom (for top bars). The workspace and mode
borders also get separated.

This behavior is consistent with i3bar.
This commit is contained in:
Konstantin Pospelov 2025-03-29 22:48:46 +01:00
parent 7e7994dbb2
commit 381c01a622
5 changed files with 85 additions and 67 deletions

View file

@ -53,6 +53,6 @@ struct swaybar_sni {
struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray);
void destroy_sni(struct swaybar_sni *sni);
uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x,
struct swaybar_sni *sni);
uint32_t height, struct swaybar_sni *sni);
#endif

View file

@ -37,6 +37,7 @@ struct swaybar_tray {
struct swaybar_tray *create_tray(struct swaybar *bar);
void destroy_tray(struct swaybar_tray *tray);
void tray_in(int fd, short mask, void *data);
uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x);
uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output,
double *x, uint32_t height);
#endif