diff --git a/src/lib/input.c b/src/lib/input.c index f9f226ce0..a44e2b68a 100644 --- a/src/lib/input.c +++ b/src/lib/input.c @@ -456,7 +456,7 @@ block_on_input(tinfo* ti, const struct timespec* ts){ return -1; #else struct pollfd pfd = { - .fd = ti->input->infd, + .fd = ti->input.infd, .events = POLLIN, .revents = 0, }; @@ -1690,7 +1690,8 @@ scan_for_clrs(ncinputlayer* ni){ // appropriate. we can be interrupted by a new user context. we enter holding // the input lock, and leave holding the input lock, giving it up only while // blocking for readable action. -void ncinput_extract_clrs(tinfo* ti, ncinputlayer* ni){ +void ncinput_extract_clrs(tinfo* ti){ + ncinputlayer* ni = &ti->input; do{ if(ni->inputbuf_occupied){ scan_for_clrs(ni); diff --git a/src/lib/input.h b/src/lib/input.h index 35ee56186..15b95b9c1 100644 --- a/src/lib/input.h +++ b/src/lib/input.h @@ -57,7 +57,7 @@ int cbreak_mode(struct tinfo* ti); // assuming the user context is not active, go through current data looking // for a cursor location report. if we find none, block on input, and read if // appropriate. we can be interrupted by a new user context. -void ncinput_extract_clrs(struct tinfo* ti, struct ncinputlayer* nilayer); +void ncinput_extract_clrs(struct tinfo* ti); #ifdef __cplusplus } diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index d0f6b6552..ef6ef115c 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -987,7 +987,7 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){ } // this can block. we must enter holding the input lock, and it will // return to us holding the input lock. - ncinput_extract_clrs(&ti->input); + ncinput_extract_clrs(ti); if( (clr = ti->input.creport_queue) ){ break; } @@ -1004,7 +1004,7 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){ *cursor_x = tmp; } free(clr); -#endif +#else CONSOLE_SCREEN_BUFFER_INFO conbuf; if(!GetConsoleScreenBufferInfo(ti->outhandle, &conbuf)){ logerror("couldn't get cursor info\n"); @@ -1013,5 +1013,6 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){ *cursor_y = conbuf.dwCursorPosition.Y; *cursor_x = conbuf.dwCursorPosition.X; loginfo("got a report from y=%d x=%d\n", *cursor_y, *cursor_x); +#endif return 0; }