|
|
@ -14,6 +14,7 @@
|
|
|
|
#include <wlr/types/wlr_wl_shell.h>
|
|
|
|
#include <wlr/types/wlr_wl_shell.h>
|
|
|
|
#include <wlr/util/region.h>
|
|
|
|
#include <wlr/util/region.h>
|
|
|
|
#include "log.h"
|
|
|
|
#include "log.h"
|
|
|
|
|
|
|
|
#include "sway/config.h"
|
|
|
|
#include "sway/input/input-manager.h"
|
|
|
|
#include "sway/input/input-manager.h"
|
|
|
|
#include "sway/input/seat.h"
|
|
|
|
#include "sway/input/seat.h"
|
|
|
|
#include "sway/layers.h"
|
|
|
|
#include "sway/layers.h"
|
|
|
@ -321,6 +322,15 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
|
|
|
struct wlr_box box;
|
|
|
|
struct wlr_box box;
|
|
|
|
float color[4];
|
|
|
|
float color[4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int other_views = 1;
|
|
|
|
|
|
|
|
if (config->hide_edge_borders == E_SMART) {
|
|
|
|
|
|
|
|
struct sway_container *ws = container_parent(con, C_WORKSPACE);
|
|
|
|
|
|
|
|
other_views = container_count_descendants_of_type(ws, C_VIEW) - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config->hide_edge_borders != E_VERTICAL
|
|
|
|
|
|
|
|
&& config->hide_edge_borders != E_BOTH
|
|
|
|
|
|
|
|
&& (config->hide_edge_borders != E_SMART || other_views)) {
|
|
|
|
// Child border - left edge
|
|
|
|
// Child border - left edge
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
color[3] *= con->alpha;
|
|
|
|
color[3] *= con->alpha;
|
|
|
@ -331,7 +341,8 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
|
|
|
|
// Child border - right edge
|
|
|
|
// Child border - right edge
|
|
|
|
if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
|
|
|
|
if (con->parent->children->length == 1
|
|
|
|
|
|
|
|
&& con->parent->layout == L_HORIZ) {
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
@ -342,9 +353,14 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
|
|
|
box.width = con->sway_view->border_thickness;
|
|
|
|
box.width = con->sway_view->border_thickness;
|
|
|
|
box.height = con->height - 1;
|
|
|
|
box.height = con->height - 1;
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config->hide_edge_borders != E_HORIZONTAL
|
|
|
|
|
|
|
|
&& config->hide_edge_borders != E_BOTH
|
|
|
|
|
|
|
|
&& (config->hide_edge_borders != E_SMART || other_views)) {
|
|
|
|
// Child border - bottom edge
|
|
|
|
// Child border - bottom edge
|
|
|
|
if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
|
|
|
|
if (con->parent->children->length == 1
|
|
|
|
|
|
|
|
&& con->parent->layout == L_VERT) {
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
@ -392,12 +408,14 @@ static void render_container_simple_border_normal(struct sway_output *output,
|
|
|
|
&texture_box.width, &texture_box.height);
|
|
|
|
&texture_box.width, &texture_box.height);
|
|
|
|
|
|
|
|
|
|
|
|
float matrix[9];
|
|
|
|
float matrix[9];
|
|
|
|
wlr_matrix_project_box(matrix, &texture_box, WL_OUTPUT_TRANSFORM_NORMAL,
|
|
|
|
wlr_matrix_project_box(matrix, &texture_box,
|
|
|
|
|
|
|
|
WL_OUTPUT_TRANSFORM_NORMAL,
|
|
|
|
0.0, output->wlr_output->transform_matrix);
|
|
|
|
0.0, output->wlr_output->transform_matrix);
|
|
|
|
|
|
|
|
|
|
|
|
render_texture(output->wlr_output, output_damage, title_texture,
|
|
|
|
render_texture(output->wlr_output, output_damage, title_texture,
|
|
|
|
&texture_box, matrix, 1.0);
|
|
|
|
&texture_box, matrix, 1.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -409,6 +427,15 @@ static void render_container_simple_border_pixel(struct sway_output *output,
|
|
|
|
struct wlr_box box;
|
|
|
|
struct wlr_box box;
|
|
|
|
float color[4];
|
|
|
|
float color[4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int other_views = 1;
|
|
|
|
|
|
|
|
if (config->hide_edge_borders == E_SMART) {
|
|
|
|
|
|
|
|
struct sway_container *ws = container_parent(con, C_WORKSPACE);
|
|
|
|
|
|
|
|
other_views = container_count_descendants_of_type(ws, C_VIEW) - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config->hide_edge_borders != E_VERTICAL
|
|
|
|
|
|
|
|
&& config->hide_edge_borders != E_BOTH
|
|
|
|
|
|
|
|
&& (config->hide_edge_borders != E_SMART || other_views)) {
|
|
|
|
// Child border - left edge
|
|
|
|
// Child border - left edge
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
color[3] *= con->alpha;
|
|
|
|
color[3] *= con->alpha;
|
|
|
@ -419,7 +446,8 @@ static void render_container_simple_border_pixel(struct sway_output *output,
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
|
|
|
|
// Child border - right edge
|
|
|
|
// Child border - right edge
|
|
|
|
if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
|
|
|
|
if (con->parent->children->length == 1
|
|
|
|
|
|
|
|
&& con->parent->layout == L_HORIZ) {
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
@ -430,7 +458,11 @@ static void render_container_simple_border_pixel(struct sway_output *output,
|
|
|
|
box.width = con->sway_view->border_thickness;
|
|
|
|
box.width = con->sway_view->border_thickness;
|
|
|
|
box.height = con->height;
|
|
|
|
box.height = con->height;
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config->hide_edge_borders != E_HORIZONTAL
|
|
|
|
|
|
|
|
&& config->hide_edge_borders != E_BOTH
|
|
|
|
|
|
|
|
&& (config->hide_edge_borders != E_SMART || other_views)) {
|
|
|
|
// Child border - top edge
|
|
|
|
// Child border - top edge
|
|
|
|
box.x = con->x;
|
|
|
|
box.x = con->x;
|
|
|
|
box.y = con->y;
|
|
|
|
box.y = con->y;
|
|
|
@ -439,7 +471,8 @@ static void render_container_simple_border_pixel(struct sway_output *output,
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
|
|
|
|
// Child border - bottom edge
|
|
|
|
// Child border - bottom edge
|
|
|
|
if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
|
|
|
|
if (con->parent->children->length == 1
|
|
|
|
|
|
|
|
&& con->parent->layout == L_VERT) {
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->indicator, sizeof(float) * 4);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
|
memcpy(&color, colors->child_border, sizeof(float) * 4);
|
|
|
@ -450,6 +483,7 @@ static void render_container_simple_border_pixel(struct sway_output *output,
|
|
|
|
box.width = con->width;
|
|
|
|
box.width = con->width;
|
|
|
|
box.height = con->sway_view->border_thickness;
|
|
|
|
box.height = con->sway_view->border_thickness;
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
render_rect(output->wlr_output, output_damage, &box, color);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void render_container(struct sway_output *output,
|
|
|
|
static void render_container(struct sway_output *output,
|
|
|
|