Using the Linux FrameBuffer and libinput
Uno supports the Linux FrameBuffer and libinput as a target, in the case where your target device does not provide a Window Manager.
There are restrictions for the support for the FrameBuffer:
- The
TextBoxcontrol is not supported. If you need text input, you will need to implement an on-screen keyboard manually using the Keyboard and Pointer events that Uno provides (in theCoreWindowclass). - The mouse is supported through pointer events, but Uno does not show the pointer for your app. You'll need to display one using the pointer events provided by Uno (also in the
CoreWindowclass). - It is only supported on Linux where
/dev/fbXXis available.
Get started with the FrameBuffer
- Follow the getting started guide
Create a new app using
dotnet new unoapp -o MyApp
You'll get a set of projects, including one named MyApp.Skia.Linux.FrameBuffer.
You can build and run this app by navigating to the MyApp.Skia.Linux.FrameBuffer and type the following:
dotnet run
The app will start and display on the first available framebuffer device. To change the active framebuffer, set the device name in the FRAMEBUFFER environment variable.
By default, the Debug configuration is used, which will show logging information in the current terminal and may overwrite the UI content.
To read the logging information, either:
- Launch the application from a different terminal (through SSH, for instance)
- Launch the app using
dotnet run > logging.txt 2>&1, then launchtail -f logging.txtin another terminal.
Once the application is running, you can exit the application with:
Ctrl+CF12, a key configuration found in theProgram.csfile of your project which invokesApplication.Current.Exit()
Creating a standalone app
You can create a standalone publication folder using the following:
dotnet publish -c Release -r linux-x64 --self-contained true
Note
When using the Release configuration, logging is disabled for performance considerations. You can restore logging in the App.xaml.cs file.
Documentation on other hardware targets is available here.
DPI Scaling support
Whenever possible, the FrameBufferHost will try to detect the actual DPI scale to use when rendering the UI, based on the physical information provided by the FrameBuffer driver. If the value cannot be determined, a scale of 1.0 is used.
The automatic scaling can be overridden in two ways:
- Set a value using
FrameBufferHost.DisplayScale. - Set a value through the
UNO_DISPLAY_SCALE_OVERRIDEenvironment variable. This value has precedence over the value specified inFrameBufferHost.DisplayScale.
Additional dependencies
If your device is significantly trimmed down for installed packages, you'll need to install:
libfontconfiglibfreetypelibinput