linux: add a function to check if we're running on X11

This commit is contained in:
Riccardo Binetti
2024-01-07 16:54:01 +01:00
parent f679489a65
commit fe0842c2d0

View File

@ -13,6 +13,12 @@ pub fn is_display(display: ?*c.GdkDisplay) bool {
) != 0;
}
/// Returns true if the app is running on X11
pub fn is_current_display_server() bool {
const display = c.gdk_display_get_default();
return is_display(display);
}
pub const Xkb = struct {
base_event_code: c_int,
funcs: Funcs,