mirror of
https://github.com/apache/nuttx.git
synced 2026-05-10 15:30:25 +08:00
bf83ff3fbd
The X11 event loop in the POSIX simulator was processing MotionNotify (touch/mouse movement)and ButtonPress/ButtonRelease events unconditionally, even when the touchscreen feature(CONFIG_SIM_TOUCHSCREEN) was disabled. This could lead to unnecessary event processing, potential compiler warnings about unusedfunctions (e.g., sim_buttonevent), or unintended behavior in simulator builds withouttouchscreen support. The touchscreen-related event handling should only be active whenthe corresponding configuration is enabled. This fix wraps the MotionNotify and ButtonPress/ButtonRelease event handling logicwith #ifdef CONFIG_SIM_TOUCHSCREEN guards to: 1. Ensure touchscreen/mouse event processing is only compiled when CONFIG_SIM_TOUCHSCREEN is enabled. 2. Eliminate unused code warnings in non-touchscreen simulator builds. 3. Align event loop behavior with the configured feature set, reducing unnecessary runtime overhead. The change maintains full touchscreen functionality when the config is enabled, whilecleaning up the code path for builds that don't require touchscreen support. Signed-off-by: chao an <anchao.archer@bytedance.com>