I need some design advice for Tasks/Threads in offscreen mode, as well as mouse/keyboard recommondations for windowless mode.
I want to run CEF in windowless mode on a ARM64 system on a Yocto Linux without X or Wayland. I build a simple proof of concept using cefsimple, adding windowless_rendering_enabled=1 and writing my own renderer based on CefRenderHandler. Works so far so good.
I would like to add rudimentary USB mouse and keyboard support for very simple user input. As I have no window manager I have to do this manually (as per my understanding). So I have written small code pieces that basically run endless loops, blocking read on /dev/input/eventX, parse the input and send mouse/keyboard events to the browser class. The code pieces are posted as tasks to TID_FILE_USER_BLOCKING. This however works only for the first posted task, the second task is never started (Execute() never called).
- Code: Select all
CefPostTask(TID_FILE_USER_BLOCKING, task_mouse);
CefPostTask(TID_FILE_USER_BLOCKING, task_keyboard);
My questions regarding tasking/threading:
Am I going the wrong way? Can I actually run multiple endless tasks parallel?
Or should I rather create a thread / multiple threads for endless blocking file read loops?
Can someone recommend a CEF thread example?
In addition, if someone can recommend a better solution than writing my own mouse / keyboard handlers without a window manager, your advice would be very appreciated.
Cheers, Martin