aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-01 19:21:29 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-01 19:21:29 +1000
commita19a511b90d214f200bfca1cffad0376b855caac (patch)
tree9d8934d26cf9e222665716beb14ca7b4ecd8ea10 /sway/desktop/output.c
parentScale borders according to output scale (diff)
downloadsway-a19a511b90d214f200bfca1cffad0376b855caac.tar.gz
sway-a19a511b90d214f200bfca1cffad0376b855caac.tar.zst
sway-a19a511b90d214f200bfca1cffad0376b855caac.zip
Implement indicator border
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 498a3a2e..e0a211d1 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -245,6 +245,11 @@ static void render_container_simple_border_normal(struct sway_output *output,
245 output->wlr_output->transform_matrix); 245 output->wlr_output->transform_matrix);
246 246
247 // Child border - right edge 247 // Child border - right edge
248 if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
249 memcpy(&color, colors->indicator, sizeof(float) * 3);
250 } else {
251 memcpy(&color, colors->child_border, sizeof(float) * 3);
252 }
248 box.x = con->x + con->width - con->sway_view->border_thickness; 253 box.x = con->x + con->width - con->sway_view->border_thickness;
249 box.y = con->y + 1; 254 box.y = con->y + 1;
250 box.width = con->sway_view->border_thickness; 255 box.width = con->sway_view->border_thickness;
@@ -254,6 +259,11 @@ static void render_container_simple_border_normal(struct sway_output *output,
254 output->wlr_output->transform_matrix); 259 output->wlr_output->transform_matrix);
255 260
256 // Child border - bottom edge 261 // Child border - bottom edge
262 if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
263 memcpy(&color, colors->indicator, sizeof(float) * 3);
264 } else {
265 memcpy(&color, colors->child_border, sizeof(float) * 3);
266 }
257 box.x = con->x; 267 box.x = con->x;
258 box.y = con->y + con->height - con->sway_view->border_thickness; 268 box.y = con->y + con->height - con->sway_view->border_thickness;
259 box.width = con->width; 269 box.width = con->width;
@@ -317,6 +327,11 @@ static void render_container_simple_border_pixel(struct sway_output *output,
317 output->wlr_output->transform_matrix); 327 output->wlr_output->transform_matrix);
318 328
319 // Child border - right edge 329 // Child border - right edge
330 if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
331 memcpy(&color, colors->indicator, sizeof(float) * 3);
332 } else {
333 memcpy(&color, colors->child_border, sizeof(float) * 3);
334 }
320 box.x = con->x + con->width - con->sway_view->border_thickness; 335 box.x = con->x + con->width - con->sway_view->border_thickness;
321 box.y = con->y; 336 box.y = con->y;
322 box.width = con->sway_view->border_thickness; 337 box.width = con->sway_view->border_thickness;
@@ -335,6 +350,11 @@ static void render_container_simple_border_pixel(struct sway_output *output,
335 output->wlr_output->transform_matrix); 350 output->wlr_output->transform_matrix);
336 351
337 // Child border - bottom edge 352 // Child border - bottom edge
353 if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
354 memcpy(&color, colors->indicator, sizeof(float) * 3);
355 } else {
356 memcpy(&color, colors->child_border, sizeof(float) * 3);
357 }
338 box.x = con->x; 358 box.x = con->x;
339 box.y = con->y + con->height - con->sway_view->border_thickness; 359 box.y = con->y + con->height - con->sway_view->border_thickness;
340 box.width = con->width; 360 box.width = con->width;