mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
calculate borders for hiding from workspace geometry
This commit is contained in:
parent
f181bf9c54
commit
b893f07ce1
@ -571,29 +571,22 @@ void update_geometry(swayc_t *container) {
|
|||||||
|
|
||||||
// handle hide_edge_borders
|
// handle hide_edge_borders
|
||||||
if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && ws->children->length == 1))) {
|
if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && ws->children->length == 1))) {
|
||||||
swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
|
|
||||||
const struct wlc_size *size = wlc_output_get_resolution(output->handle);
|
|
||||||
|
|
||||||
if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
|
if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
|
||||||
if (geometry.origin.x == 0 || geometry.origin.x == container->x) {
|
if (geometry.origin.x == ws->x) {
|
||||||
// should work for swaybar at left
|
|
||||||
border_left = 0;
|
border_left = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geometry.origin.x + geometry.size.w == size->w || geometry.size.w == container->width) {
|
if (geometry.origin.x + geometry.size.w == ws->width) {
|
||||||
// should work for swaybar at right
|
|
||||||
border_right = 0;
|
border_right = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
|
if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
|
||||||
if (geometry.origin.y == 0 || geometry.origin.y == container->y) {
|
if (geometry.origin.y == ws->y) {
|
||||||
// this works for swaybar at top
|
|
||||||
border_top = 0;
|
border_top = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geometry.origin.y + geometry.size.h == size->h || geometry.size.h == container->height) {
|
if (geometry.origin.y + geometry.size.h == ws->height) {
|
||||||
// this works for swaybar at bottom
|
|
||||||
border_bottom = 0;
|
border_bottom = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user