feat(effects): implement window rounded corners via scenefx

- Parse effects.windows.rounded/rounding from Lua config
- Add CfgEffectsWindows and CfgEffects structs to Config
- Switch to fx_renderer_create for scenefx support
- Replace 5 wlr/types/wlr_scene.h includes with scenefx variant
- Add config_get_corner_radius() helper (light=6px, heavy=14px)
- Apply corner_radii_top/bottom/left/right to 4 border rects
- Apply wlr_scene_buffer_set_corner_radius to surface buffers
- Disable on fullscreen, restore on exit
- Re-apply on resize and config hot-reload
- Add -Wno-extra-semi for scenefx header compatibility
- All targets compile cleanly (make test passes)
This commit is contained in:
2026-07-02 05:00:26 -04:00
parent 20e38fe682
commit 4ac03d4059
9 changed files with 146 additions and 15 deletions
+32
View File
@@ -618,6 +618,37 @@ parse_autostart(lua_State *L, Config *cfg)
lua_pop(L, 1);
}
static void
parse_effects(lua_State *L, CfgEffects *e)
{
/* Defaults */
e->windows.rounded = false;
strcpy(e->windows.rounding, "off");
lua_getglobal(L, "effects");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
return;
}
lua_getfield(L, -1, "windows");
if (!lua_istable(L, -1)) {
lua_pop(L, 2); /* pop windows + effects */
return;
}
e->windows.rounded = lua_get_bool(L, "rounded", false);
char scratch[CFG_MAX_STRLEN] = {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");
lua_pop(L, 2); /* pop windows + effects */
}
/* Public API */
char *
@@ -686,6 +717,7 @@ config_load(const char *path, Config *cfg)
parse_buttons (L, cfg);
parse_scrolls (L, cfg);
parse_autostart (L, cfg);
parse_effects (L, &cfg->effects);
lua_close(L);
return 0;
+13
View File
@@ -104,6 +104,17 @@ typedef struct {
char cmd[CFG_MAX_AUTOSTART_CMD];
} CfgAutostart;
/* Effects */
typedef struct {
bool rounded;
char rounding[CFG_MAX_STRLEN];
} CfgEffectsWindows;
typedef struct {
CfgEffectsWindows windows;
} CfgEffects;
/* the whole shebang */
typedef struct {
@@ -135,6 +146,8 @@ typedef struct {
/* Per-workspace (tag) default layouts, indexed by tag index 0-8 */
char workspace_layouts[9][CFG_MAX_STRLEN];
CfgEffects effects;
} Config;
/* Public API */