aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-07-21 16:56:44 -0400
committerGitHub <noreply@github.com>2016-07-21 16:56:44 -0400
commit9fe1d3da381296966e01d922ce6e54d0e55e7c00 (patch)
treeda08882e578e55e1a39e2f20ad359330ad20fe7d /sway
parentf181bf9c542ccb0478f653bbab76f60ac198a800 (diff)
parent03b0180c302b1f6feeecd39fd76f84f7a99abf34 (diff)
Merge pull request #778 from thejan2009/hide_edge_borders-fix
Hide edge borders fix
Diffstat (limited to 'sway')
-rw-r--r--sway/layout.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sway/layout.c b/sway/layout.c
index faa108a1..3285560b 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -522,8 +522,8 @@ void update_geometry(swayc_t *container) {
return;
}
- swayc_t *ws = swayc_parent_by_type(container, C_WORKSPACE);
- swayc_t *op = ws->parent;
+ swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
+ swayc_t *op = workspace->parent;
swayc_t *parent = container->parent;
struct wlc_geometry geometry = {
@@ -552,7 +552,7 @@ void update_geometry(swayc_t *container) {
geometry.origin.y = 0;
geometry.size.w = size->w;
geometry.size.h = size->h;
- if (op->focused == ws) {
+ if (op->focused == workspace) {
wlc_view_bring_to_front(container->handle);
}
@@ -570,30 +570,23 @@ void update_geometry(swayc_t *container) {
int border_right = container->border_thickness;
// handle hide_edge_borders
- 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_NONE && (gap <= 0 || (config->smart_gaps && workspace->children->length == 1))) {
if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
- if (geometry.origin.x == 0 || geometry.origin.x == container->x) {
- // should work for swaybar at left
+ if (geometry.origin.x == workspace->x) {
border_left = 0;
}
- if (geometry.origin.x + geometry.size.w == size->w || geometry.size.w == container->width) {
- // should work for swaybar at right
+ if (geometry.origin.x + geometry.size.w == workspace->width) {
border_right = 0;
}
}
if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
- if (geometry.origin.y == 0 || geometry.origin.y == container->y) {
- // this works for swaybar at top
+ if (geometry.origin.y == workspace->y) {
border_top = 0;
}
- if (geometry.origin.y + geometry.size.h == size->h || geometry.size.h == container->height) {
- // this works for swaybar at bottom
+ if (geometry.origin.y + geometry.size.h == workspace->height) {
border_bottom = 0;
}
}