Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#125 apply VRR_OFF via CLI and cfg.yaml #126

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ void desire_adaptive_sync(struct Head *head) {
return;
}

if (!slist_find_equal(cfg->adaptive_sync_off_name_desc, head_name_desc_matches_head, head)) {
if (slist_find_equal(cfg->adaptive_sync_off_name_desc, head_name_desc_matches_head, head)) {
head->desired.adaptive_sync = ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED;
} else {
head->desired.adaptive_sync = ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED;
}
}
Expand Down
14 changes: 7 additions & 7 deletions tst/tst-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ void desire_scale__user(void **state) {
void desire_adaptive_sync__head_disabled(void **state) {
struct Head head0 = {
.desired.enabled = false,
.desired.adaptive_sync = ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED,
.desired.adaptive_sync = ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED,
};

desire_adaptive_sync(&head0);

assert_int_equal(head0.desired.adaptive_sync, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED);
assert_int_equal(head0.desired.adaptive_sync, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED);
}

void desire_adaptive_sync__failed(void **state) {
Expand All @@ -522,7 +522,7 @@ void desire_adaptive_sync__failed(void **state) {
assert_int_equal(head0.desired.adaptive_sync, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED);
}

void desire_adaptive_sync__adaptive_sync_off(void **state) {
void desire_adaptive_sync__disabled(void **state) {
struct Head head0 = {
.name = "some head",
.desired.enabled = true,
Expand All @@ -533,10 +533,10 @@ void desire_adaptive_sync__adaptive_sync_off(void **state) {

desire_adaptive_sync(&head0);

assert_int_equal(head0.desired.adaptive_sync, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED);
assert_int_equal(head0.desired.adaptive_sync, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED);
}

void desire_adaptive_sync__ok(void **state) {
void desire_adaptive_sync__enabled(void **state) {
struct Head head0 = {
.desired.enabled = true,
.desired.adaptive_sync = ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED,
Expand Down Expand Up @@ -682,8 +682,8 @@ int main(void) {

TEST(desire_adaptive_sync__head_disabled),
TEST(desire_adaptive_sync__failed),
TEST(desire_adaptive_sync__adaptive_sync_off),
TEST(desire_adaptive_sync__ok),
TEST(desire_adaptive_sync__disabled),
TEST(desire_adaptive_sync__enabled),

TEST(handle_success__head_changing_adaptive_sync),
TEST(handle_success__head_changing_adaptive_sync_fail),
Expand Down