You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add Wayland support
Not everything is yet implemented, either for Godot or personal limitations (I don't have all hardware in the world). A brief list of the most important issues follows: - Single-window only: the `DisplayServer` API doesn't expose enough information for properly creating XDG shell windows. - Very dumb rendering loop: this is very complicated, just know that the low consumption mode is forced to 2000 Hz and some clever hacks are in place to overcome a specific Wayland limitation. This will be improved to the extent possible both downstream and upstream. - Features to implement yet: IME, touch input, native file dialog, drawing tablet (commented out due to a refactor), screen recording. - Mouse passthrough can't be implement through a poly API, we need a rect-based one. - The cursor doesn't yet support fractional scaling. - Auto scale is rounded up when using fractional scaling as we don't have a per-window scale query API (basically we need `DisplayServer::window_get_scale`). - Building with `x11=no wayland=yes opengl=yes openxr=yes` fails. This also adds a new project property and editor setting for selecting the default DisplayServer to start, to allow this backend to start first in exported projects (X11 is still the default for now). The editor setting always overrides the project setting. Special thanks to Drew Devault, toger5, Sebastian Krzyszkowiak, Leandro Benedet Garcia, Subhransu, Yury Zhuravlev and Mara Huldra.
This commit is contained in:
@@ -39,6 +39,10 @@
|
||||
#include "x11/display_server_x11.h"
|
||||
#endif
|
||||
|
||||
#ifdef WAYLAND_ENABLED
|
||||
#include "wayland/display_server_wayland.h"
|
||||
#endif
|
||||
|
||||
#include "modules/modules_enabled.gen.h" // For regex.
|
||||
#ifdef MODULE_REGEX_ENABLED
|
||||
#include "modules/regex/regex.h"
|
||||
@@ -123,6 +127,14 @@ void OS_LinuxBSD::alert(const String &p_alert, const String &p_title) {
|
||||
}
|
||||
}
|
||||
|
||||
int OS_LinuxBSD::get_low_processor_usage_mode_sleep_usec() const {
|
||||
if (DisplayServer::get_singleton() == nullptr || DisplayServer::get_singleton()->get_name() != "Wayland" || is_in_low_processor_usage_mode()) {
|
||||
return OS::get_low_processor_usage_mode_sleep_usec();
|
||||
}
|
||||
|
||||
return 500; // Roughly 2000 FPS, improves frame time when emulating VSync.
|
||||
}
|
||||
|
||||
void OS_LinuxBSD::initialize() {
|
||||
crash_handler.initialize();
|
||||
|
||||
@@ -1166,6 +1178,10 @@ OS_LinuxBSD::OS_LinuxBSD() {
|
||||
DisplayServerX11::register_x11_driver();
|
||||
#endif
|
||||
|
||||
#ifdef WAYLAND_ENABLED
|
||||
DisplayServerWayland::register_wayland_driver();
|
||||
#endif
|
||||
|
||||
#ifdef FONTCONFIG_ENABLED
|
||||
#ifdef SOWRAP_ENABLED
|
||||
#ifdef DEBUG_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user