kmscon cursor report uses 0-indexing, account in ncdirect_cursor_yx() #2044

pull/2048/head
nick black 3 years ago
parent f0b94273e3
commit 9a6389661e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -447,11 +447,14 @@ int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
int tmp = *y; int tmp = *y;
*y = *x; *y = *x;
*x = tmp; *x = tmp;
} }else{
// we use 0-based coordinates, but known terminals use 1-based coordinates // we use 0-based coordinates, but known terminals use 1-based
// coordinates. the only known exception is kmscon, which is
// incidentally the only one which inverts its response.
--*y; --*y;
--*x; --*x;
} }
}
if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){ if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){
fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n", fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n",
n->tcache.ttyfd, strerror(errno)); // don't return error for this n->tcache.ttyfd, strerror(errno)); // don't return error for this

Loading…
Cancel
Save