diff options
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/detect.py | 6 | ||||
-rw-r--r-- | platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml | 2 | ||||
-rw-r--r-- | platform/linuxbsd/joypad_linux.cpp | 20 | ||||
-rw-r--r-- | platform/linuxbsd/os_linuxbsd.cpp | 34 | ||||
-rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 6 |
5 files changed, 33 insertions, 35 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 9faa73d6d2..ce743fbf8a 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -235,11 +235,15 @@ def configure(env: "Environment"): env.ParseConfig("pkg-config libenet --cflags --libs") if not env["builtin_squish"]: - env.ParseConfig("pkg-config libsquish --cflags --libs") + # libsquish doesn't reliably install its .pc file, so some distros lack it. + env.Append(LIBS=["libsquish"]) if not env["builtin_zstd"]: env.ParseConfig("pkg-config libzstd --cflags --libs") + if env["brotli"] and not env["builtin_brotli"]: + env.ParseConfig("pkg-config libbrotlicommon libbrotlidec --cflags --libs") + # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) diff --git a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml index 77a6ece756..07378566c3 100644 --- a/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml +++ b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorExportPlatformLinuxBSD" inherits="EditorExportPlatformPC" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="EditorExportPlatformLinuxBSD" inherits="EditorExportPlatformPC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Exporter for Linux/BSD. </brief_description> diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index ab79885fb4..71c03898c8 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -98,19 +98,20 @@ static bool detect_sandbox() { JoypadLinux::JoypadLinux(Input *in) { #ifdef UDEV_ENABLED -#ifdef SOWRAP_ENABLED -#ifdef DEBUG_ENABLED - int dylibloader_verbose = 1; -#else - int dylibloader_verbose = 0; -#endif if (detect_sandbox()) { // Linux binaries in sandboxes / containers need special handling because // libudev doesn't work there. So we need to fallback to manual parsing // of /dev/input in such case. use_udev = false; print_verbose("JoypadLinux: udev enabled, but detected incompatible sandboxed mode. Falling back to /dev/input to detect joypads."); - } else { + } +#ifdef SOWRAP_ENABLED + else { +#ifdef DEBUG_ENABLED + int dylibloader_verbose = 1; +#else + int dylibloader_verbose = 0; +#endif use_udev = initialize_libudev(dylibloader_verbose) == 0; if (use_udev) { if (!udev_new || !udev_unref || !udev_enumerate_new || !udev_enumerate_add_match_subsystem || !udev_enumerate_scan_devices || !udev_enumerate_get_list_entry || !udev_list_entry_get_next || !udev_list_entry_get_name || !udev_device_new_from_syspath || !udev_device_get_devnode || !udev_device_get_action || !udev_device_unref || !udev_enumerate_unref || !udev_monitor_new_from_netlink || !udev_monitor_filter_add_match_subsystem_devtype || !udev_monitor_enable_receiving || !udev_monitor_get_fd || !udev_monitor_receive_device || !udev_monitor_unref) { @@ -124,10 +125,11 @@ JoypadLinux::JoypadLinux(Input *in) { print_verbose("JoypadLinux: udev enabled, but couldn't be loaded. Falling back to /dev/input to detect joypads."); } } -#endif +#endif // SOWRAP_ENABLED #else print_verbose("JoypadLinux: udev disabled, parsing /dev/input to detect joypads."); -#endif +#endif // UDEV_ENABLED + input = in; monitor_joypads_thread.start(monitor_joypads_thread_func, this); joypad_events_thread.start(joypad_events_thread_func, this); diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index 310778388b..14d02a73c8 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -954,45 +954,33 @@ static String get_mountpoint(const String &p_path) { } Error OS_LinuxBSD::move_to_trash(const String &p_path) { - String path = p_path.rstrip("/"); // Strip trailing slash when path points to a directory + // We try multiple methods, until we find one that works. + // So we only return on success until we exhausted possibilities. + String path = p_path.rstrip("/"); // Strip trailing slash when path points to a directory. int err_code; List<String> args; args.push_back(path); - args.push_front("trash"); // The command is `gio trash <file_name>` so we need to add it to args. + + args.push_front("trash"); // The command is `gio trash <file_name>` so we add it before the path. Error result = execute("gio", args, nullptr, &err_code); // For GNOME based machines. - if (result == OK) { // The `execute` function has done its job without errors. - if (!err_code) { // The shell command has been executed without errors. - return OK; - } else if (err_code == 1) { - ERR_PRINT("move_to_trash: No such file or directory as " + path + "."); - return ERR_FILE_NOT_FOUND; - } + if (result == OK && err_code == 0) { // Success. + return OK; } args.pop_front(); args.push_front("move"); args.push_back("trash:/"); // The command is `kioclient5 move <file_name> trash:/`. result = execute("kioclient5", args, nullptr, &err_code); // For KDE based machines. - if (result == OK) { // The `execute` function has done its job without errors. - if (!err_code) { // The shell command has been executed without errors. - return OK; - } else if (err_code == 1) { - ERR_PRINT("move_to_trash: No such file or directory as " + path + "."); - return ERR_FILE_NOT_FOUND; - } + if (result == OK && err_code == 0) { + return OK; } args.pop_front(); args.pop_back(); result = execute("gvfs-trash", args, nullptr, &err_code); // For older Linux machines. - if (result == OK) { // The `execute` function has done its job without errors. - if (!err_code) { // The shell command has been executed without errors. - return OK; - } else if (err_code == 1) { - ERR_PRINT("move_to_trash: No such file or directory as " + path + "."); - return ERR_FILE_NOT_FOUND; - } + if (result == OK && err_code == 0) { + return OK; } // If the commands `kioclient5`, `gio` or `gvfs-trash` don't work on the system we do it manually. diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 8724bc871a..d9e18720dc 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -5449,7 +5449,9 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode } #else #ifdef XKB_ENABLED - xkb_loaded = true; + bool xkb_loaded = true; + xkb_loaded_v05p = true; + xkb_loaded_v08p = true; #endif #endif @@ -5476,6 +5478,7 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode r_error = OK; +#ifdef SOWRAP_ENABLED { if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) { // There's no API to check version, check if functions are available instead. @@ -5484,6 +5487,7 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode return; } } +#endif for (int i = 0; i < CURSOR_MAX; i++) { cursors[i] = None; |