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.
2023-12-15 01:55:34 +00:00
|
|
|
#!/usr/bin/env python
|
2024-06-11 20:19:07 +00:00
|
|
|
from misc.utility.scons_hints import *
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
|
|
|
|
Import("env")
|
|
|
|
|
|
|
|
# TODO: Add warning to headers and code about their autogenerated status.
|
|
|
|
if env["use_sowrap"]:
|
|
|
|
# We have to implement separate builders for so wrappers as the
|
|
|
|
# autogenerated Wayland protocol wrapper must include them instead of the
|
|
|
|
# native libraries.
|
|
|
|
|
|
|
|
WAYLAND_BUILDERS_SOWRAP = {
|
|
|
|
"WAYLAND_API_HEADER": Builder(
|
|
|
|
action=Action(
|
2024-02-09 12:25:24 +00:00
|
|
|
r"wayland-scanner -c client-header < ${SOURCE} | sed 's:wayland-client-core\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
'Generating Wayland client header: "${TARGET}"',
|
|
|
|
),
|
|
|
|
single_source=True,
|
|
|
|
),
|
|
|
|
"WAYLAND_API_CODE": Builder(
|
|
|
|
action=Action(
|
2024-02-09 12:25:24 +00:00
|
|
|
r"wayland-scanner -c private-code < ${SOURCE} | sed 's:wayland-util\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
|
2024-02-07 10:09:28 +00:00
|
|
|
'Generating Wayland protocol marshaling code: "${TARGET}"',
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
),
|
|
|
|
single_source=True,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
env.Append(BUILDERS=WAYLAND_BUILDERS_SOWRAP)
|
|
|
|
else:
|
|
|
|
WAYLAND_BUILDERS = {
|
|
|
|
"WAYLAND_API_HEADER": Builder(
|
|
|
|
action=Action(
|
2024-02-09 12:25:24 +00:00
|
|
|
r"wayland-scanner -c client-header < ${SOURCE} > ${TARGET}",
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
'Generating Wayland client header: "${TARGET}"',
|
|
|
|
),
|
|
|
|
single_source=True,
|
|
|
|
),
|
|
|
|
"WAYLAND_API_CODE": Builder(
|
|
|
|
action=Action(
|
2024-02-09 12:25:24 +00:00
|
|
|
r"wayland-scanner -c private-code < ${SOURCE} > ${TARGET}",
|
2024-02-07 10:09:28 +00:00
|
|
|
'Generating Wayland protocol marshaling code: "${TARGET}"',
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
),
|
|
|
|
single_source=True,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
env.Append(BUILDERS=WAYLAND_BUILDERS)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(target="protocol/wayland.gen.h", source="#thirdparty/wayland/protocol/wayland.xml")
|
|
|
|
env.WAYLAND_API_CODE(target="protocol/wayland.gen.c", source="#thirdparty/wayland/protocol/wayland.xml")
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/viewporter.gen.h", source="#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"
|
|
|
|
)
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/viewporter.gen.c", source="#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/fractional_scale.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
|
|
|
|
)
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/fractional_scale.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/xdg_shell.gen.h", source="#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/xdg_shell.gen.c", source="#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/xdg_decoration.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/xdg_decoration.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/xdg_activation.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/xdg_activation.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/relative_pointer.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/relative_pointer.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/pointer_constraints.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/pointer_constraints.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/pointer_gestures.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/pointer_gestures.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/primary_selection.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/primary_selection.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/idle_inhibit.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/idle_inhibit.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/tablet.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/tablet.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
|
|
|
|
)
|
|
|
|
|
2024-06-11 09:24:54 +00:00
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/text_input.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/text_input.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
|
|
|
|
)
|
|
|
|
|
2024-01-31 09:43:56 +00:00
|
|
|
env.WAYLAND_API_HEADER(
|
|
|
|
target="protocol/xdg_foreign.gen.h",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
|
|
|
env.WAYLAND_API_CODE(
|
|
|
|
target="protocol/xdg_foreign.gen.c",
|
|
|
|
source="#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
|
|
|
|
)
|
|
|
|
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
source_files = [
|
|
|
|
"protocol/wayland.gen.c",
|
|
|
|
"protocol/viewporter.gen.c",
|
|
|
|
"protocol/fractional_scale.gen.c",
|
|
|
|
"protocol/xdg_shell.gen.c",
|
2024-01-31 09:43:56 +00:00
|
|
|
"protocol/xdg_foreign.gen.c",
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
"protocol/xdg_decoration.gen.c",
|
|
|
|
"protocol/xdg_activation.gen.c",
|
|
|
|
"protocol/relative_pointer.gen.c",
|
|
|
|
"protocol/pointer_constraints.gen.c",
|
|
|
|
"protocol/pointer_gestures.gen.c",
|
|
|
|
"protocol/primary_selection.gen.c",
|
|
|
|
"protocol/idle_inhibit.gen.c",
|
|
|
|
"protocol/tablet.gen.c",
|
2024-06-11 09:24:54 +00:00
|
|
|
"protocol/text_input.gen.c",
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
"display_server_wayland.cpp",
|
|
|
|
"wayland_thread.cpp",
|
|
|
|
"key_mapping_xkb.cpp",
|
|
|
|
"detect_prime_egl.cpp",
|
|
|
|
]
|
|
|
|
|
|
|
|
if env["use_sowrap"]:
|
|
|
|
source_files.append(
|
|
|
|
[
|
|
|
|
"dynwrappers/wayland-cursor-so_wrap.c",
|
|
|
|
"dynwrappers/wayland-client-core-so_wrap.c",
|
|
|
|
"dynwrappers/wayland-egl-core-so_wrap.c",
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
if env["libdecor"]:
|
|
|
|
source_files.append("dynwrappers/libdecor-so_wrap.c")
|
|
|
|
|
|
|
|
|
|
|
|
if env["vulkan"]:
|
2023-12-19 17:57:56 +00:00
|
|
|
source_files.append("rendering_context_driver_vulkan_wayland.cpp")
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
|
|
|
|
if env["opengl3"]:
|
|
|
|
source_files.append("egl_manager_wayland.cpp")
|
2024-05-02 15:32:13 +00:00
|
|
|
source_files.append("egl_manager_wayland_gles.cpp")
|
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.
2023-12-15 01:55:34 +00:00
|
|
|
|
|
|
|
objects = []
|
|
|
|
|
|
|
|
for source_file in source_files:
|
|
|
|
objects.append(env.Object(source_file))
|
|
|
|
|
|
|
|
Return("objects")
|