ssd: drop-shadows on tiled windows

This commit is contained in:
diredocks 2025-06-05 15:33:24 +08:00
parent 9af441ecd3
commit 0dbcd2221a
5 changed files with 10 additions and 1 deletions

View file

@ -524,6 +524,9 @@ extending outward from the snapped edge.
*<theme><dropShadows>* [yes|no] *<theme><dropShadows>* [yes|no]
Should drop-shadows be rendered behind windows. Default is no. Should drop-shadows be rendered behind windows. Default is no.
*<theme><dropShadowsOnTiled>* [yes|no]
Should drop-shadows be rendered behind tiled windows. Default is no.
*<theme><font place="">* *<theme><font place="">*
The font to use for a specific element of a window, menu or OSD. The font to use for a specific element of a window, menu or OSD.
Places can be any of: Places can be any of:

View file

@ -38,6 +38,7 @@
<cornerRadius>8</cornerRadius> <cornerRadius>8</cornerRadius>
<keepBorder>yes</keepBorder> <keepBorder>yes</keepBorder>
<dropShadows>no</dropShadows> <dropShadows>no</dropShadows>
<dropShadowsOnTiled>no</dropShadowsOnTiled>
<font place="ActiveWindow"> <font place="ActiveWindow">
<name>sans</name> <name>sans</name>
<size>10</size> <size>10</size>

View file

@ -92,6 +92,7 @@ struct rcxml {
bool title_layout_loaded; bool title_layout_loaded;
bool ssd_keep_border; bool ssd_keep_border;
bool shadows_enabled; bool shadows_enabled;
bool shadows_on_tiled;
struct font font_activewindow; struct font font_activewindow;
struct font font_inactivewindow; struct font font_inactivewindow;
struct font font_menuheader; struct font font_menuheader;

View file

@ -1155,6 +1155,8 @@ entry(xmlNode *node, char *nodename, char *content, struct parser_state *state)
set_bool(content, &rc.ssd_keep_border); set_bool(content, &rc.ssd_keep_border);
} else if (!strcasecmp(nodename, "dropShadows.theme")) { } else if (!strcasecmp(nodename, "dropShadows.theme")) {
set_bool(content, &rc.shadows_enabled); set_bool(content, &rc.shadows_enabled);
} else if (!strcasecmp(nodename, "dropShadowsOnTiled.theme")) {
set_bool(content, &rc.shadows_on_tiled);
} else if (!strcmp(nodename, "name.font.theme")) { } else if (!strcmp(nodename, "name.font.theme")) {
fill_font(nodename, content, font_place); fill_font(nodename, content, font_place);
} else if (!strcmp(nodename, "size.font.theme")) { } else if (!strcmp(nodename, "size.font.theme")) {
@ -1508,6 +1510,7 @@ rcxml_init(void)
rc.ssd_keep_border = true; rc.ssd_keep_border = true;
rc.corner_radius = 8; rc.corner_radius = 8;
rc.shadows_enabled = false; rc.shadows_enabled = false;
rc.shadows_on_tiled = false;
rc.gap = 0; rc.gap = 0;
rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED; rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED;

View file

@ -291,7 +291,8 @@ ssd_shadow_update(struct ssd *ssd)
struct view *view = ssd->view; struct view *view = ssd->view;
bool maximized = view->maximized == VIEW_AXIS_BOTH; bool maximized = view->maximized == VIEW_AXIS_BOTH;
bool show_shadows = bool show_shadows =
rc.shadows_enabled && !maximized && !view_is_tiled(ssd->view); rc.shadows_enabled && !maximized &&
(!view_is_tiled(ssd->view) || rc.shadows_on_tiled);
wlr_scene_node_set_enabled(&ssd->shadow.tree->node, show_shadows); wlr_scene_node_set_enabled(&ssd->shadow.tree->node, show_shadows);
if (show_shadows) { if (show_shadows) {
set_shadow_geometry(ssd); set_shadow_geometry(ssd);