Hello, We are using Avalonia on Torizon OS extension of VS-code. we need the display (through the VGA) and the mouse interaction. Display is fine but the mouse cursor is not visible. However I can see its responsive through my debug consule when testing it (clickings,scrolling, cursor movement).
The issue is as can be read from the debug console :
[LinuxFramebuffer/Input/LibInput/Pointer] The pointer event LIBINPUT_EVENT_POINTER_MOTION is not mapped. (LibInputBackend #11404313).
I’m having hard time trying to map it, is there a straight forward solution for this?
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?
Mouse Cursor Visibility Solution for Avalonia on Torizon OS
Based on the issue you’re describing with the mouse cursor not being visible in Avalonia while using VGA output, this appears to be related to cursor theme configuration in Weston.
Solution: Configure Mouse Cursor in Weston
The mouse cursor visibility can be controlled through Weston configuration. You can change the mouse cursor by adding a custom cursor configuration to your weston.ini file (1).
Add the following configuration to your weston.ini file:
If you need to make the cursor transparent for touch displays that use mouse input, you can use a transparent cursor. A transparent cursor can be found in this GitHub repository and has been tested to work in the Weston container (1).
Additional Considerations
Since you’re experiencing LIBINPUT_EVENT_POINTER_MOTION mapping issues, this suggests that the input events are being received by libinput but not properly handled by your display framework. The Weston cursor configuration should help resolve the visibility issue while maintaining the input functionality you’re already observing.
Implementation Steps
Modify your Weston configuration to include the cursor settings shown above
Add the cursor theme files to the appropriate location (/usr/share/icons/hicolor/cursors/)
Restart your Weston container to apply the changes
The cursor configuration needs to be applied at the Weston compositor level since that’s what manages the display output for your VGA connection.
To clarify, which Avalonia template are you using?
There are two templates for Avalonia the Framebuffer one and the GTK MVVM one. I believe the framebuffer one does not have a native cursor/pointer implementation at all. While the GTK MVVM one does.
From what I understand this needs to be custom implemented in the application since Avalonia does not provide it. The specifics on how though are not really known to us. We don’t have any examples of a custom cursor implementations in Avalonia. There may be some examples available online, but we don’t have anything we can point to at the moment that we know works.
Otherwise, this may likely require an expert in such graphics frameworks to properly implement this.
Have you already committed to using framebuffer Avalonia?
we have not commited yet. In fact we are trying to use the DRM(Direct Render Manager) and compare it to the frame buffer in order to check the graphic acceleration. In case we are not commited are there some solutions you might suggest?
Well recommending a specific GUI framework is tricky as it highly depends on your requirements and limitations.
Just based on what you have shared here. Probably a more modern, well supported framework would be beneficial.
Something like QT would be fairly standard. Additionally it’s a well documented framework with many resources for support. We also have templates from graphics partners like Slint, LVGL, or Flutter. Though these come from partners so support questions may need to be directed towards them.
Anyways, the point is I wasn’t specifically trying to get you off Avalonia. I was just making sure you were aware of the limitations of the framework. It’s lack of support for things like cursor and such. Not impossible to implement, but we’re not exactly GUI/Avalonia experts so the support and knowledge we can provide on such topics is limited. So implementing things like a cursor in an Avalonia based application is not something we have knowledge or experience with.
With more popular or modern frameworks there’s usually more documentation and a wider community to get help from.