Fix rounded corners
they were being dumb
This commit is contained in:
+1
-2
@@ -58,8 +58,7 @@ monitors = {
|
|||||||
--
|
--
|
||||||
effects = {
|
effects = {
|
||||||
windows = {
|
windows = {
|
||||||
rounded = false,
|
corner_radius = 0, -- 0 = off, or a pixel value like 6, 10, 14
|
||||||
rounding = "none", -- off, light, or heavy
|
|
||||||
|
|
||||||
shadows = {
|
shadows = {
|
||||||
shadows = true,
|
shadows = true,
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ typedef struct Client {
|
|||||||
|
|
||||||
Monitor *mon;
|
Monitor *mon;
|
||||||
struct wlr_scene_tree *scene;
|
struct wlr_scene_tree *scene;
|
||||||
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
struct wlr_scene_rect *border_bg; /* single border rect with clipped content hole */
|
||||||
struct wlr_scene_tree *scene_surface;
|
struct wlr_scene_tree *scene_surface;
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_list flink;
|
struct wl_list flink;
|
||||||
|
|||||||
+4
-10
@@ -655,8 +655,7 @@ static void
|
|||||||
parse_effects(lua_State *L, CfgEffects *e)
|
parse_effects(lua_State *L, CfgEffects *e)
|
||||||
{
|
{
|
||||||
/* Defaults */
|
/* Defaults */
|
||||||
e->windows.rounded = false;
|
e->windows.corner_radius = 0;
|
||||||
strcpy(e->windows.rounding, "off");
|
|
||||||
|
|
||||||
lua_getglobal(L, "effects");
|
lua_getglobal(L, "effects");
|
||||||
if (!lua_istable(L, -1)) {
|
if (!lua_istable(L, -1)) {
|
||||||
@@ -670,14 +669,9 @@ parse_effects(lua_State *L, CfgEffects *e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
e->windows.rounded = lua_get_bool(L, "rounded", false);
|
e->windows.corner_radius = lua_get_int(L, "corner_radius", 0);
|
||||||
|
if (e->windows.corner_radius < 0)
|
||||||
char scratch[CFG_MAX_STRLEN] = {0};
|
e->windows.corner_radius = 0;
|
||||||
lua_get_string(L, "rounding", scratch, sizeof(scratch));
|
|
||||||
if (!strcmp(scratch, "light") || !strcmp(scratch, "heavy"))
|
|
||||||
strncpy(e->windows.rounding, scratch, CFG_MAX_STRLEN - 1);
|
|
||||||
else
|
|
||||||
strcpy(e->windows.rounding, "off");
|
|
||||||
|
|
||||||
parse_shadows(L, &e->windows.shadows);
|
parse_shadows(L, &e->windows.shadows);
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -122,8 +122,7 @@ typedef struct {
|
|||||||
} CfgEffectsWindowShadows;
|
} CfgEffectsWindowShadows;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool rounded;
|
int corner_radius; /* 0 = off, >0 = radius in pixels */
|
||||||
char rounding[CFG_MAX_STRLEN];
|
|
||||||
CfgEffectsWindowShadows shadows;
|
CfgEffectsWindowShadows shadows;
|
||||||
} CfgEffectsWindows;
|
} CfgEffectsWindows;
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -334,9 +334,8 @@ client_send_close(Client *c)
|
|||||||
void
|
void
|
||||||
client_set_border_color(Client *c, const float color[static 4])
|
client_set_border_color(Client *c, const float color[static 4])
|
||||||
{
|
{
|
||||||
int i;
|
if (c->border_bg)
|
||||||
for (i = 0; i < 4; i++)
|
wlr_scene_rect_set_color(c->border_bg, color);
|
||||||
wlr_scene_rect_set_color(c->border[i], color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
+103
-78
@@ -389,13 +389,7 @@ static char config_path[1024];
|
|||||||
static int
|
static int
|
||||||
config_get_corner_radius(void)
|
config_get_corner_radius(void)
|
||||||
{
|
{
|
||||||
if (!cfg.effects.windows.rounded)
|
return cfg.effects.windows.corner_radius > 0 ? cfg.effects.windows.corner_radius : 0;
|
||||||
return 0;
|
|
||||||
if (strcmp(cfg.effects.windows.rounding, "light") == 0)
|
|
||||||
return 6;
|
|
||||||
if (strcmp(cfg.effects.windows.rounding, "heavy") == 0)
|
|
||||||
return 14;
|
|
||||||
return 0; /* "off" or unknown */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Apply a workspace default layout for the given tag index (0-based) on monitor
|
/* Apply a workspace default layout for the given tag index (0-based) on monitor
|
||||||
@@ -2073,11 +2067,21 @@ static void locksession(struct wl_listener *listener, void *data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_buffer_corner_radius(struct wlr_scene_buffer *buffer,
|
apply_surface_corners(struct wlr_scene_node *node, int radius)
|
||||||
int sx, int sy, void *user_data)
|
|
||||||
{
|
{
|
||||||
int radius = *(int *)user_data;
|
if (node->type == WLR_SCENE_NODE_BUFFER) {
|
||||||
wlr_scene_buffer_set_corner_radius(buffer, radius);
|
struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(node);
|
||||||
|
if (buffer) {
|
||||||
|
wlr_scene_buffer_set_corner_radii(buffer,
|
||||||
|
corner_radii_all(radius > 0 ? radius : 0));
|
||||||
|
}
|
||||||
|
} else if (node->type == WLR_SCENE_NODE_TREE) {
|
||||||
|
struct wlr_scene_tree *tree = wlr_scene_tree_from_node(node);
|
||||||
|
struct wlr_scene_node *child;
|
||||||
|
wl_list_for_each(child, &tree->children, link) {
|
||||||
|
apply_surface_corners(child, radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mapnotify(struct wl_listener *listener, void *data) {
|
static void mapnotify(struct wl_listener *listener, void *data) {
|
||||||
@@ -2085,7 +2089,6 @@ static void mapnotify(struct wl_listener *listener, void *data) {
|
|||||||
Client *p = nullptr;
|
Client *p = nullptr;
|
||||||
Client *w, *c = wl_container_of(listener, c, map);
|
Client *w, *c = wl_container_of(listener, c, map);
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Create scene tree for this client and its border */
|
/* Create scene tree for this client and its border */
|
||||||
c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
|
c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
|
||||||
@@ -2108,23 +2111,14 @@ static void mapnotify(struct wl_listener *listener, void *data) {
|
|||||||
goto unset_fullscreen;
|
goto unset_fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
/* Create single border background rect */
|
||||||
c->border[i] =
|
c->border_bg = wlr_scene_rect_create(c->scene, 0, 0,
|
||||||
wlr_scene_rect_create(c->scene, 0, 0,
|
c->isurgent ? cfg.appearance.urgent_color : cfg.appearance.border_color);
|
||||||
c->isurgent ? cfg.appearance.urgent_color
|
c->border_bg->node.data = c;
|
||||||
: cfg.appearance.border_color);
|
|
||||||
c->border[i]->node.data = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int r = config_get_corner_radius();
|
int r = config_get_corner_radius();
|
||||||
c->corner_radius = r;
|
c->corner_radius = r;
|
||||||
if (r > 0) {
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[0], corner_radii_top(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[1], corner_radii_bottom(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[2], corner_radii_left(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[3], corner_radii_right(r));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create drop shadow */
|
/* Create drop shadow */
|
||||||
@@ -2146,7 +2140,7 @@ static void mapnotify(struct wl_listener *listener, void *data) {
|
|||||||
- cfg.effects.windows.shadows.shadow_expand,
|
- cfg.effects.windows.shadows.shadow_expand,
|
||||||
cfg.effects.windows.shadows.shadow_offset_y
|
cfg.effects.windows.shadows.shadow_offset_y
|
||||||
- cfg.effects.windows.shadows.shadow_expand);
|
- cfg.effects.windows.shadows.shadow_expand);
|
||||||
wlr_scene_node_place_below(&c->shadow->node, &c->border[0]->node);
|
wlr_scene_node_place_below(&c->shadow->node, &c->border_bg->node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2156,10 +2150,7 @@ static void mapnotify(struct wl_listener *listener, void *data) {
|
|||||||
: wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
: wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
||||||
c->scene_surface->node.data = c;
|
c->scene_surface->node.data = c;
|
||||||
|
|
||||||
if (c->corner_radius > 0) {
|
wlr_scene_node_raise_to_top(&c->border_bg->node);
|
||||||
wlr_scene_node_for_each_buffer(&c->scene_surface->node,
|
|
||||||
set_buffer_corner_radius, &c->corner_radius);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize client geometry with room for border */
|
/* Initialize client geometry with room for border */
|
||||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
|
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
|
||||||
@@ -2558,6 +2549,16 @@ static void rendermon(struct wl_listener *listener, void *data) {
|
|||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Apply corner radius to all client surfaces on this monitor */
|
||||||
|
{
|
||||||
|
Client *c;
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->mon == m && c->scene_surface && c->corner_radius > 0 && !c->isfullscreen) {
|
||||||
|
apply_surface_corners(&c->scene_surface->node, c->corner_radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wlr_scene_output_commit(m->scene_output, nullptr);
|
wlr_scene_output_commit(m->scene_output, nullptr);
|
||||||
|
|
||||||
skip:
|
skip:
|
||||||
@@ -2591,7 +2592,6 @@ static void requestmonstate(struct wl_listener *listener, void *data) {
|
|||||||
|
|
||||||
void resize(Client *c, struct wlr_box geo, int interact) {
|
void resize(Client *c, struct wlr_box geo, int interact) {
|
||||||
struct wlr_box *bbox;
|
struct wlr_box *bbox;
|
||||||
struct wlr_box clip;
|
|
||||||
|
|
||||||
if (!c->mon || !client_surface(c)->mapped)
|
if (!c->mon || !client_surface(c)->mapped)
|
||||||
return;
|
return;
|
||||||
@@ -2602,17 +2602,51 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||||||
c->geom = geo;
|
c->geom = geo;
|
||||||
applybounds(c, bbox);
|
applybounds(c, bbox);
|
||||||
|
|
||||||
/* Update scene-graph, including borders */
|
/* Update scene-graph, including border */
|
||||||
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
||||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||||
wlr_scene_rect_set_size(c->border[0], c->geom.width, c->bw);
|
|
||||||
wlr_scene_rect_set_size(c->border[1], c->geom.width, c->bw);
|
int effective_r = c->corner_radius;
|
||||||
wlr_scene_rect_set_size(c->border[2], c->bw, c->geom.height - 2 * c->bw);
|
if (effective_r > 0) {
|
||||||
wlr_scene_rect_set_size(c->border[3], c->bw, c->geom.height - 2 * c->bw);
|
if (!c->mon->gaps)
|
||||||
wlr_scene_node_set_position(&c->border[1]->node, 0, c->geom.height - c->bw);
|
effective_r = 0;
|
||||||
wlr_scene_node_set_position(&c->border[2]->node, 0, c->bw);
|
else if (cfg.appearance.smart_gaps && !c->isfloating
|
||||||
wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw,
|
&& c->geom.x == c->mon->w.x && c->geom.y == c->mon->w.y
|
||||||
c->bw);
|
&& c->geom.x + c->geom.width == c->mon->w.x + c->mon->w.width
|
||||||
|
&& c->geom.y + c->geom.height == c->mon->w.y + c->mon->w.height)
|
||||||
|
effective_r = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update single border rect with clipped region hole */
|
||||||
|
if (c->border_bg) {
|
||||||
|
int bw_i = (int)c->bw;
|
||||||
|
int cw = (int)c->geom.width;
|
||||||
|
int ch = (int)c->geom.height;
|
||||||
|
|
||||||
|
wlr_scene_rect_set_size(c->border_bg, cw, ch);
|
||||||
|
wlr_scene_node_set_position(&c->border_bg->node, 0, 0);
|
||||||
|
|
||||||
|
if (effective_r > 0 && !c->isfullscreen) {
|
||||||
|
int r = effective_r;
|
||||||
|
struct clipped_region cr = {
|
||||||
|
.area = {bw_i, bw_i, cw - 2*bw_i, ch - 2*bw_i},
|
||||||
|
.corners = corner_radii_all(r),
|
||||||
|
};
|
||||||
|
wlr_scene_rect_set_clipped_region(c->border_bg, cr);
|
||||||
|
wlr_scene_rect_set_corner_radii(c->border_bg, corner_radii_all(r));
|
||||||
|
wlr_scene_node_set_enabled(&c->border_bg->node, true);
|
||||||
|
apply_surface_corners(&c->scene_surface->node, r);
|
||||||
|
} else {
|
||||||
|
struct clipped_region cr = {
|
||||||
|
.area = {bw_i, bw_i, cw - 2*bw_i, ch - 2*bw_i},
|
||||||
|
.corners = corner_radii_new(1, 1, 1, 1), /* non-zero to keep GLES2 shader clip active */
|
||||||
|
};
|
||||||
|
wlr_scene_rect_set_clipped_region(c->border_bg, cr);
|
||||||
|
wlr_scene_rect_set_corner_radius(c->border_bg, 0);
|
||||||
|
wlr_scene_node_set_enabled(&c->border_bg->node, true);
|
||||||
|
apply_surface_corners(&c->scene_surface->node, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Update drop shadow */
|
/* Update drop shadow */
|
||||||
if (c->shadow) {
|
if (c->shadow) {
|
||||||
@@ -2621,6 +2655,12 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||||||
&& (!cfg.effects.windows.shadows.only_floating || c->isfloating);
|
&& (!cfg.effects.windows.shadows.only_floating || c->isfloating);
|
||||||
if (!cfg.effects.windows.shadows.nogaps_shadows && !c->mon->gaps)
|
if (!cfg.effects.windows.shadows.nogaps_shadows && !c->mon->gaps)
|
||||||
shadow_visible = false;
|
shadow_visible = false;
|
||||||
|
else if (!cfg.effects.windows.shadows.nogaps_shadows
|
||||||
|
&& cfg.appearance.smart_gaps && !c->isfloating
|
||||||
|
&& c->geom.x == c->mon->w.x && c->geom.y == c->mon->w.y
|
||||||
|
&& c->geom.x + c->geom.width == c->mon->w.x + c->mon->w.width
|
||||||
|
&& c->geom.y + c->geom.height == c->mon->w.y + c->mon->w.height)
|
||||||
|
shadow_visible = false;
|
||||||
wlr_scene_node_set_enabled(&c->shadow->node, shadow_visible);
|
wlr_scene_node_set_enabled(&c->shadow->node, shadow_visible);
|
||||||
|
|
||||||
if (shadow_visible) {
|
if (shadow_visible) {
|
||||||
@@ -2631,7 +2671,7 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||||||
cfg.effects.windows.shadows.shadow_offset_x - cfg.effects.windows.shadows.shadow_expand + (int)c->bw,
|
cfg.effects.windows.shadows.shadow_offset_x - cfg.effects.windows.shadows.shadow_expand + (int)c->bw,
|
||||||
cfg.effects.windows.shadows.shadow_offset_y - cfg.effects.windows.shadows.shadow_expand + (int)c->bw);
|
cfg.effects.windows.shadows.shadow_offset_y - cfg.effects.windows.shadows.shadow_expand + (int)c->bw);
|
||||||
|
|
||||||
int effective_r_for_shadow = c->corner_radius > 0 ? c->corner_radius : 0;
|
int effective_r_for_shadow = effective_r > 0 ? effective_r : c->corner_radius;
|
||||||
wlr_scene_shadow_set_corner_radius(c->shadow, effective_r_for_shadow);
|
wlr_scene_shadow_set_corner_radius(c->shadow, effective_r_for_shadow);
|
||||||
wlr_scene_shadow_set_blur_sigma(c->shadow,
|
wlr_scene_shadow_set_blur_sigma(c->shadow,
|
||||||
(float)cfg.effects.windows.shadows.shadow_radius);
|
(float)cfg.effects.windows.shadows.shadow_radius);
|
||||||
@@ -2645,7 +2685,12 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||||||
if (cfg.effects.windows.shadows.shadow_clip) {
|
if (cfg.effects.windows.shadows.shadow_clip) {
|
||||||
int cr_val = effective_r_for_shadow;
|
int cr_val = effective_r_for_shadow;
|
||||||
struct clipped_region cr = {
|
struct clipped_region cr = {
|
||||||
.area = {(int)c->bw, (int)c->bw, (int)(c->geom.width - 2 * (int)c->bw), (int)(c->geom.height - 2 * (int)c->bw)},
|
.area = {
|
||||||
|
cfg.effects.windows.shadows.shadow_expand - cfg.effects.windows.shadows.shadow_offset_x,
|
||||||
|
cfg.effects.windows.shadows.shadow_expand - cfg.effects.windows.shadows.shadow_offset_y,
|
||||||
|
(int)(c->geom.width - 2 * (int)c->bw),
|
||||||
|
(int)(c->geom.height - 2 * (int)c->bw)
|
||||||
|
},
|
||||||
.corners = corner_radii_new(cr_val, cr_val, cr_val, cr_val),
|
.corners = corner_radii_new(cr_val, cr_val, cr_val, cr_val),
|
||||||
};
|
};
|
||||||
wlr_scene_shadow_set_clipped_region(c->shadow, cr);
|
wlr_scene_shadow_set_clipped_region(c->shadow, cr);
|
||||||
@@ -2653,19 +2698,9 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->corner_radius > 0 && !c->isfullscreen) {
|
|
||||||
int r = c->corner_radius;
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[0], corner_radii_top(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[1], corner_radii_bottom(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[2], corner_radii_left(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[3], corner_radii_right(r));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this is a no-op if size hasn't changed */
|
/* this is a no-op if size hasn't changed */
|
||||||
c->resize =
|
c->resize =
|
||||||
client_set_size(c, c->geom.width - 2 * c->bw, c->geom.height - 2 * c->bw);
|
client_set_size(c, c->geom.width - 2 * c->bw, c->geom.height - 2 * c->bw);
|
||||||
client_get_clip(c, &clip);
|
|
||||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void run(char *startup_cmd) {
|
static void run(char *startup_cmd) {
|
||||||
@@ -2785,21 +2820,13 @@ static void setfullscreen(Client *c, int fullscreen) {
|
|||||||
c->bw = fullscreen ? 0 : cfg.appearance.border_px;
|
c->bw = fullscreen ? 0 : cfg.appearance.border_px;
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
c->corner_radius = 0;
|
c->corner_radius = 0;
|
||||||
int zero = 0;
|
if (c->border_bg) {
|
||||||
wlr_scene_node_for_each_buffer(&c->scene_surface->node,
|
wlr_scene_node_set_enabled(&c->border_bg->node, false);
|
||||||
set_buffer_corner_radius, &zero);
|
}
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
wlr_scene_rect_set_corner_radius(c->border[i], 0);
|
|
||||||
} else {
|
} else {
|
||||||
int r = config_get_corner_radius();
|
c->corner_radius = config_get_corner_radius();
|
||||||
c->corner_radius = r;
|
if (c->border_bg) {
|
||||||
if (r > 0) {
|
wlr_scene_node_set_enabled(&c->border_bg->node, true);
|
||||||
wlr_scene_rect_set_corner_radii(c->border[0], corner_radii_top(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[1], corner_radii_bottom(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[2], corner_radii_left(r));
|
|
||||||
wlr_scene_rect_set_corner_radii(c->border[3], corner_radii_right(r));
|
|
||||||
wlr_scene_node_for_each_buffer(&c->scene_surface->node,
|
|
||||||
set_buffer_corner_radius, &r);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client_set_fullscreen(c, fullscreen);
|
client_set_fullscreen(c, fullscreen);
|
||||||
@@ -3041,18 +3068,17 @@ reapply_client_appearance(void)
|
|||||||
if (!client_is_unmanaged(c)) {
|
if (!client_is_unmanaged(c)) {
|
||||||
int r = c->isfullscreen ? 0 : config_get_corner_radius();
|
int r = c->isfullscreen ? 0 : config_get_corner_radius();
|
||||||
c->corner_radius = r;
|
c->corner_radius = r;
|
||||||
|
if (c->border_bg) {
|
||||||
if (r > 0 && !c->isfullscreen) {
|
if (r > 0 && !c->isfullscreen) {
|
||||||
wlr_scene_rect_set_corner_radii(c->border[0], corner_radii_top(r));
|
wlr_scene_rect_set_corner_radii(c->border_bg, corner_radii_all(r));
|
||||||
wlr_scene_rect_set_corner_radii(c->border[1], corner_radii_bottom(r));
|
wlr_scene_node_set_enabled(&c->border_bg->node, true);
|
||||||
wlr_scene_rect_set_corner_radii(c->border[2], corner_radii_left(r));
|
} else if (c->isfullscreen) {
|
||||||
wlr_scene_rect_set_corner_radii(c->border[3], corner_radii_right(r));
|
wlr_scene_node_set_enabled(&c->border_bg->node, false);
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < 4; i++)
|
wlr_scene_rect_set_corner_radius(c->border_bg, 0);
|
||||||
wlr_scene_rect_set_corner_radius(c->border[i], 0);
|
wlr_scene_node_set_enabled(&c->border_bg->node, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int radius = r;
|
|
||||||
wlr_scene_node_for_each_buffer(&c->scene_surface->node,
|
|
||||||
set_buffer_corner_radius, &radius);
|
|
||||||
/* Shadow re-apply on config reload */
|
/* Shadow re-apply on config reload */
|
||||||
if (cfg.effects.windows.shadows.shadows) {
|
if (cfg.effects.windows.shadows.shadows) {
|
||||||
if (!c->shadow) {
|
if (!c->shadow) {
|
||||||
@@ -3074,7 +3100,7 @@ reapply_client_appearance(void)
|
|||||||
cfg.effects.windows.shadows.shadow_offset_y
|
cfg.effects.windows.shadows.shadow_offset_y
|
||||||
- cfg.effects.windows.shadows.shadow_expand);
|
- cfg.effects.windows.shadows.shadow_expand);
|
||||||
wlr_scene_node_place_below(&c->shadow->node,
|
wlr_scene_node_place_below(&c->shadow->node,
|
||||||
&c->border[0]->node);
|
&c->border_bg->node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -3088,8 +3114,7 @@ reapply_client_appearance(void)
|
|||||||
float *color = c->isurgent ? cfg.appearance.urgent_color
|
float *color = c->isurgent ? cfg.appearance.urgent_color
|
||||||
: c == focustop(c->mon) ? cfg.appearance.focus_color
|
: c == focustop(c->mon) ? cfg.appearance.focus_color
|
||||||
: cfg.appearance.border_color;
|
: cfg.appearance.border_color;
|
||||||
for (int i = 0; i < 4; i++)
|
client_set_border_color(c, color);
|
||||||
wlr_scene_rect_set_color(c->border[i], color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user