ssd: add configurable drop-shadows for tiled windows

This commit is contained in:
dd 2025-06-06 04:46:58 +08:00 committed by GitHub
parent 0908bb5dd1
commit c5b9e2665d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 2 deletions

View file

@ -284,9 +284,19 @@ ssd_shadow_update(struct ssd *ssd)
assert(ssd->shadow.tree);
struct view *view = ssd->view;
struct theme *theme = ssd->view->server->theme;
bool maximized = view->maximized == VIEW_AXIS_BOTH;
bool show_shadows =
rc.shadows_enabled && !maximized && !view_is_tiled(ssd->view);
bool tiled_shadows = false;
if (rc.shadows_on_tiled) {
if (rc.gap >= theme->window[THEME_ACTIVE].shadow_size
&& rc.gap >= theme->window[THEME_INACTIVE].shadow_size) {
tiled_shadows = true;
} else {
wlr_log(WLR_INFO, "gap size < shadow_size, ignore rc.shadows_ontiled");
}
};
bool show_shadows = rc.shadows_enabled && !maximized
&& (!view_is_tiled(ssd->view) || tiled_shadows);
wlr_scene_node_set_enabled(&ssd->shadow.tree->node, show_shadows);
if (show_shadows) {
set_shadow_geometry(ssd);