opt: use config.xxx instead of global presets

This commit is contained in:
tonybanters 2026-03-12 06:49:58 -07:00 committed by DreamMaoMao
parent 1fc89d01eb
commit a7461d9d5b
13 changed files with 826 additions and 997 deletions

View file

@ -60,7 +60,7 @@ void handle_tearing_new_object(struct wl_listener *listener, void *data) {
bool check_tearing_frame_allow(Monitor *m) {
/* never allow tearing when disabled */
if (!allow_tearing) {
if (!config.allow_tearing) {
return false;
}
@ -72,7 +72,7 @@ bool check_tearing_frame_allow(Monitor *m) {
}
/* allow tearing for any window when requested or forced */
if (allow_tearing == TEARING_ENABLED) {
if (config.allow_tearing == TEARING_ENABLED) {
if (c->force_tearing == STATE_UNSPECIFIED) {
return c->tearing_hint;
} else {
@ -87,7 +87,8 @@ bool check_tearing_frame_allow(Monitor *m) {
if (c->force_tearing == STATE_UNSPECIFIED) {
/* honor the tearing hint or the fullscreen-force preference */
return c->tearing_hint || allow_tearing == TEARING_FULLSCREEN_ONLY;
return c->tearing_hint ||
config.allow_tearing == TEARING_FULLSCREEN_ONLY;
}
/* honor tearing as requested by action */