This page lists tips many common tasks when developing applications for different platforms
Windows
Coming soon!
macOS
Coming soon!
Freedesktop
Installing files in standard directories
On Unix-based systems, it's really important to make sure you're following the Filesystem hierarchy standard and XDG base directory specifications. You can use the XDG basedir submodule for an easy way to get the correct directories.
Desktop files
When developing an application for freedesktop-based systems, you
need a .desktop
file for it. This file lists metadata, that
controls the following:
- Whether the application can be seen in the menus
- What file types the application can open
- Name of the application in multiple languages
- And more
Here is an example desktop file, which details everything about it.
After being installed to /usr/share/applications/
the
application will appear in the menus and application search in the
desktop.
[Desktop Entry]
Type=Application
Version=1.0
Name=UntitledDesktop Session Logout
GenericName=SessionLogout
Comment=Allows the user to log out, power off, restart and put the computer to sleep using a GUI
Icon=ude-session-logout
TryExec=ude-session-logout
Exec=ude-session-logout
Categories=System;Utility;
Terminal=false
StartupNotify=false
More information on the Freedesktop desktop entry specification.
Interacting with the desktop environment
Many applications may need to interact with the desktop environment as part of their feature set. On Freedesktop systems most interactions between applications go through standardised DBus interfaces. You can enable the dbus submodule to easily communicate over the bus in a type- and memory-safe manner.
There are many standard interfaces, however there are 2 main types:
- Normal interfaces
- XDG desktop portals
Normal interfaces and XDG desktop portal interfaces can be very similar, however there are a few differences. For starters, XDG desktop portals were created for applications that were are containerised in environments like Flatpak or Snaps. They may provide better security features, or may be updated more frequently compared to normal interfaces. On the other hand, they may lack many features that might be a security concern in containerised workflows.
A list of XDG desktop portal interfaces can be found here.
A list of normal standardised DBus interfaces can be found here, though they are mixed with other XDG standards.
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Developer and contributor resources
- Misc