Revert "parser: add CfgApplyEffects struct and extend CfgRule with fullscreen, can_float, can_fullscreen, apply_effects"
This reverts commit 690c328c38.
This commit is contained in:
+2
-37
@@ -296,44 +296,9 @@ parse_rules(lua_State *L, Config *cfg)
|
||||
memset(r, 0, sizeof(*r));
|
||||
lua_get_string(L, "app_id", r->app_id, sizeof(r->app_id));
|
||||
lua_get_string(L, "title", r->title, sizeof(r->title));
|
||||
r->fullscreen = lua_get_bool(L, "fullscreen", false);
|
||||
r->can_float = lua_get_bool(L, "can_float", true);
|
||||
r->can_fullscreen= lua_get_bool(L, "can_fullscreen", true);
|
||||
|
||||
/* tags: "any" → 0 (all tags), number → as-is, missing → 0 */
|
||||
lua_getfield(L, -1, "tags");
|
||||
if (lua_isstring(L, -1) && !strcmp(lua_tostring(L, -1), "any"))
|
||||
r->tags = 0;
|
||||
else
|
||||
r->tags = (uint32_t)(lua_isnumber(L, -1)
|
||||
? (int)lua_tointeger(L, -1) : 0);
|
||||
lua_pop(L, 1);
|
||||
|
||||
r->tags = (uint32_t)lua_get_int(L, "tags", 0);
|
||||
r->floating = lua_get_bool(L, "floating", false);
|
||||
|
||||
/* monitor: "default" → -1 (current), number → as-is, missing → -1 */
|
||||
lua_getfield(L, -1, "monitor");
|
||||
if (lua_isstring(L, -1) && !strcmp(lua_tostring(L, -1), "default"))
|
||||
r->monitor = -1;
|
||||
else
|
||||
r->monitor = lua_isnumber(L, -1)
|
||||
? (int)lua_tointeger(L, -1) : -1;
|
||||
lua_pop(L, 1);
|
||||
|
||||
/* Default: all effects follow global (true = no override) */
|
||||
memset(&r->apply_effects, 1, sizeof(r->apply_effects));
|
||||
lua_getfield(L, -1, "apply_effects");
|
||||
if (lua_istable(L, -1)) {
|
||||
r->apply_effects.rounding = lua_get_bool(L, "rounding", true);
|
||||
r->apply_effects.shadows = lua_get_bool(L, "shadows", true);
|
||||
r->apply_effects.transparency = lua_get_bool(L, "transparency", true);
|
||||
r->apply_effects.blur = lua_get_bool(L, "blur", true);
|
||||
r->apply_effects.gaps = lua_get_bool(L, "gaps", true);
|
||||
r->apply_effects.smartgaps = lua_get_bool(L, "smartgaps", true);
|
||||
r->apply_effects.border = lua_get_bool(L, "border", true);
|
||||
r->apply_effects.sloppy_focus = lua_get_bool(L, "sloppy_focus", true);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
r->monitor = lua_get_int(L, "monitor", -1);
|
||||
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
+5
-22
@@ -45,31 +45,14 @@ typedef struct {
|
||||
int tap_button_map; /* libinput enum value */
|
||||
} CfgInput;
|
||||
|
||||
/* Per-rule effect toggles — which effects to apply to matched windows */
|
||||
|
||||
typedef struct {
|
||||
bool rounding;
|
||||
bool shadows;
|
||||
bool transparency;
|
||||
bool blur;
|
||||
bool gaps;
|
||||
bool smartgaps;
|
||||
bool border;
|
||||
bool sloppy_focus;
|
||||
} CfgApplyEffects;
|
||||
|
||||
/* Window Rules */
|
||||
|
||||
typedef struct {
|
||||
char app_id[CFG_MAX_STRLEN];
|
||||
char title[CFG_MAX_STRLEN]; /* empty string = wildcard */
|
||||
uint32_t tags;
|
||||
bool floating;
|
||||
bool fullscreen;
|
||||
bool can_float;
|
||||
bool can_fullscreen;
|
||||
CfgApplyEffects apply_effects;
|
||||
int monitor; /* -1 = current */
|
||||
char app_id[CFG_MAX_STRLEN];
|
||||
char title[CFG_MAX_STRLEN]; /* empty string = wildcard */
|
||||
uint32_t tags;
|
||||
bool floating;
|
||||
int monitor; /* -1 = current */
|
||||
} CfgRule;
|
||||
|
||||
/* Monitor Rules */
|
||||
|
||||
Reference in New Issue
Block a user