summaryrefslogtreecommitdiff
path: root/Xext/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/sync.c')
-rw-r--r--Xext/sync.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 5f4ce56bc..667f8ab78 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -962,28 +962,24 @@ SyncComputeBracketValues(SyncCounter *pCounter, Bool startOver)
pnewltval = &psci->bracket_less;
}
}
- else if ( (pTrigger->test_type == XSyncPositiveTransition &&
+ else if (pTrigger->test_type == XSyncNegativeTransition &&
ct != XSyncCounterNeverIncreases)
- ||
- (pTrigger->test_type == XSyncNegativeTransition &&
+ {
+ if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
+ {
+ psci->bracket_less = pTrigger->test_value;
+ pnewltval = &psci->bracket_less;
+ }
+ }
+ else if (pTrigger->test_type == XSyncPositiveTransition &&
ct != XSyncCounterNeverDecreases)
- )
{
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value))
+ if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
{
- if (XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- else
- if (XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
+ psci->bracket_greater = pTrigger->test_value;
+ pnewgtval = &psci->bracket_greater;
}
}
} /* end for each trigger */