tearing: add fullscreen options (#1941)

Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
This commit is contained in:
Jens Peters 2024-08-06 22:23:10 +02:00 committed by GitHub
parent 19f0b769de
commit 433a4509af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 105 additions and 20 deletions

View file

@ -772,6 +772,20 @@ set_adaptive_sync_mode(const char *str, enum adaptive_sync_mode *variable)
}
}
static void
set_tearing_mode(const char *str, enum tearing_mode *variable)
{
if (!strcasecmp(str, "fullscreen")) {
*variable = LAB_TEARING_FULLSCREEN;
} else if (!strcasecmp(str, "fullscreenForced")) {
*variable = LAB_TEARING_FULLSCREEN_FORCED;
} else if (parse_bool(str, -1) == 1) {
*variable = LAB_TEARING_ENABLED;
} else {
*variable = LAB_TEARING_DISABLED;
}
}
static void
entry(xmlNode *node, char *nodename, char *content)
{
@ -886,7 +900,7 @@ entry(xmlNode *node, char *nodename, char *content)
} else if (!strcasecmp(nodename, "adaptiveSync.core")) {
set_adaptive_sync_mode(content, &rc.adaptive_sync);
} else if (!strcasecmp(nodename, "allowTearing.core")) {
set_bool(content, &rc.allow_tearing);
set_tearing_mode(content, &rc.allow_tearing);
} else if (!strcasecmp(nodename, "reuseOutputMode.core")) {
set_bool(content, &rc.reuse_output_mode);
} else if (!strcmp(nodename, "policy.placement")) {