- if (!with_keypress &&
- !(previously && identical(*output,previously))) {
- debugf("PAGING wait_for_stability simple\n");
- break;
- }
-
- if (last && identical(*output,last)) {
- debugf("PAGING wait_for_stability stabilised\n");
- break;
+ if (!last) {
+ debugf("PAGING wait_for_stability first...\n");
+ last=*output; *output=0;
+ } else if (!identical(*output,last)) {
+ debugf("PAGING wait_for_stability changed...\n");
+ free(last); last=*output; *output=0;
+ nidentical=0;
+ } else {
+ nidentical++;
+ int threshold=
+ !previously ? 3 :
+ identical(*output,previously) ? 3
+ : 1;
+ debugf("PAGING wait_for_stability nidentical=%d threshold=%d\n",
+ nidentical, threshold);
+ if (nidentical >= threshold)
+ break;