ghaerr commented on issue #18566:
URL: https://github.com/apache/nuttx/issues/18566#issuecomment-4702499318

   Hello @Acfboy,
   
   > I encountered a strange issue when running mwdemo.c
   
   Very nice debugging work!! I would agree with both your conclusions. Thank 
you for writing up such a precise description of your observations and 
understanding. 
   
   > MwSelect does not behave as its implementation implies. It should return 
immediately if the timer has already expired.
   
   We need to trace a few functions to figure more about why `MwSelect` isn't 
returning immediately; perhaps adding some debug code to MwGetNextTimeoutValue 
will show whether the previous SetTimer inserted a timeout into its list. The 
code seems to show that if there is no MW timer, then GdGetNextTimeout is used, 
which of course as you point out is causing the select to wait until the next 
mouse/keyboard event. Looking at the mwdemo.c code, it seems there should 
always be a timer set (when TIMERDEMO is set, of course).
   
   > Why is the drawing process so slow (about 100ms)?
   
   I'm not sure, but perhaps temporarily increasing the timeout passed to 
SetTimer to a fixed large value would allow us to learn whether the long draw 
times are somehow responsible for not receiving a WM_TIMER message and 
continuing the draw loop.
   I've just tested in macOS using the same MwSelect function and everything 
seems to be working over here.
   
   Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to