Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement a Wayland DisplayServer #57025

Closed
wants to merge 591 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
591 commits
Select commit Hold shift + click to select a range
85c4c64
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jan 23, 2023
1f3e0c5
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jan 24, 2023
3744c36
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jan 25, 2023
f051ea1
Port the whole new Unicode handling
Riteo Jan 25, 2023
e3185fc
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jan 25, 2023
2d1c168
Embed Wayland headers, remove dependency from CI
Riteo Jan 25, 2023
fe44420
Hopefully fix python formatting
Riteo Jan 25, 2023
ceb7c53
Remove the `dynwrappers` formatter exception
Riteo Jan 27, 2023
9059f97
Rollback accidental useless change
Riteo Jan 27, 2023
7e9d28e
CI: Add libwayland-bin dependency
Riteo Jan 27, 2023
65184fd
Fix Wayland protocol wrapper postprocessing.
Riteo Jan 27, 2023
02f0450
Tweak the protocol wrapper postprocessor
Riteo Jan 27, 2023
26d7a65
Add a wayland-scanner check for now
Riteo Jan 27, 2023
eb4cd76
Embed also wayland-client.h and wayland-client-protocol.h
Riteo Jan 27, 2023
f848923
Add the embedded wayland headers to CPPPATH
Riteo Jan 27, 2023
7c5047c
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jan 30, 2023
c8aefde
Implement basic tablet support.
Riteo Jan 13, 2023
380b606
Merge remote-tracking branch 'origin' into wayland
Riteo Feb 1, 2023
af68cce
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Feb 1, 2023
19ad033
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Feb 11, 2023
077b3fc
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Feb 13, 2023
108d0de
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Mar 2, 2023
32a8cbd
Fix OpenGL OpenXR with so-wrapper-less Wayland only builds
Riteo Mar 2, 2023
5fc53fd
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Mar 2, 2023
68377c7
Embed libdecor libraries
Riteo Mar 3, 2023
d7f578a
Add GLAD support for EGL PRIME detection
Riteo Mar 3, 2023
695e78c
Normalize tilt and add some comments
Riteo Mar 3, 2023
ac618fb
Associate the alpha of custom cursors
Riteo Mar 18, 2023
7653bb3
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Mar 18, 2023
7082faa
Make double click actually check for the last click distance
Riteo Mar 19, 2023
5c6eeec
Check for double clicks separately from one another
Riteo Mar 19, 2023
f9f9c4b
Fix CI
Riteo Mar 19, 2023
bba52dc
Implement custom app ids
Riteo Apr 4, 2023
61672fd
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Apr 4, 2023
11915eb
Switch to reverse-dns app ids
Riteo Apr 5, 2023
06ec619
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Apr 12, 2023
5f1bcb6
Port "Fix custom cursor using atlas texture" to DisplayServerWayland
Riteo Apr 12, 2023
9715e74
Fix typo in alpha premultiplication
Riteo Apr 12, 2023
3dc575c
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo May 11, 2023
fb65c04
Add a comment about how GDCLASS is unneeded.
Riteo May 11, 2023
82cc1f2
Wayland: Add support for VRAM-compressed custom mouse cursor images
Riteo May 11, 2023
217df75
XKBcommon: Add some missing keycodes/scancodes.
Riteo May 11, 2023
6419391
Make codespell happy
Riteo May 11, 2023
b9047f1
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo May 12, 2023
c63afbe
Fix shadowing in the EGL PRIME detection code
Riteo May 12, 2023
8572096
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo May 25, 2023
e1191df
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo May 31, 2023
53b5091
Begin working on HiDPI support
Riteo Jun 2, 2023
733068c
Begin refactoring into a separate `WaylandThread` class
Riteo Jun 6, 2023
e009580
Begin using wl_proxy user data more, add dynamic output scale handling
Riteo Jun 6, 2023
54d8ced
Move wl_output event handling into WaylandThread
Riteo Jun 7, 2023
92212c4
Move wl_display to WaylandThread
Riteo Jun 8, 2023
1deac2a
Move output data handling to WaylandThread
Riteo Jun 8, 2023
f0019b6
Fix crash on failed load
Riteo Jun 10, 2023
65d5904
Fix yet another init crash
Riteo Jun 10, 2023
82e7eb3
My brain stopped working for a bit
Riteo Jun 10, 2023
9c8ecf5
Destroy stuff in the thread only if initialized
Riteo Jun 10, 2023
cb60c2f
Add window ids into WaylandThread's API
Riteo Jun 14, 2023
6411eb2
Move most of window stuff inside WaylandThread, flesh its API more
Riteo Jun 15, 2023
34d0fff
Rename `WaylandMessage` to `Message`
Riteo Jun 15, 2023
ec3c483
Move WaylandThread in its own header and hack a lot of stuff into it
Riteo Jun 15, 2023
116b448
Refactor a bit the godot-side window data
Riteo Jun 15, 2023
57c3286
Improve lots of stuff, break even more
Riteo Jun 19, 2023
b473432
Bring back key repeating
Riteo Jun 19, 2023
bc9cc11
Fix some stuff, reimplement mouse modes and warping
Riteo Jun 20, 2023
4ac8ffc
Comment out window resizing
Riteo Jun 20, 2023
49dca2a
Restore automatic hint resizing and add it to libdecor's branch
Riteo Jun 20, 2023
c059181
Bring back keyboard layout handling and make it actually work lol
Riteo Jun 21, 2023
365b5b4
Restore and refactor clipboard support in WaylandThread
Riteo Jun 22, 2023
f3b5a5d
Get rid of WaylandState \o/
Riteo Jun 22, 2023
f95d21e
Port custom cursors to WaylandThread
Riteo Jun 24, 2023
247ddfd
Kinda port window mode handling
Riteo Jun 25, 2023
6a18fec
Fix window scale at startup, implement screen_get_scale
Riteo Jun 25, 2023
9e6e1f8
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Jun 25, 2023
84c7725
Merge branch 'wayland-thread-refactor' into wayland
Riteo Jun 25, 2023
94c8e62
Wayland: [DisplayServer] Add method to check if native window is focu…
Riteo Jun 26, 2023
c690d9a
Fix shadowing warnings
Riteo Jun 26, 2023
ba2fff3
Uncomment window attention
Riteo Jun 26, 2023
34a4bc3
Tidy up some includes, move some of them in the implementations
Riteo Jun 26, 2023
934e683
Make codespell happy
Riteo Jun 26, 2023
1765f18
Implement auto scale
Riteo Jun 26, 2023
b075313
Fix wrong listener data being set for new primary selection devices
Riteo Jul 16, 2023
e2a1f23
Merge remote-tracking branch 'origin/master' into wayland
Riteo Jul 16, 2023
afa3872
Fix build
Riteo Jul 16, 2023
c0c8ad3
Merge commit '013e8e3afb982d4b230f0039b6dc248b48794ab9' into wayland
Riteo Aug 17, 2023
5dd2093
Manually handle frame events
Riteo Aug 17, 2023
74dbcc3
Move Wayland error handling in WaylandThread, improve event loop
Riteo Aug 18, 2023
056bb61
Make vsync emulation code messages verbose
Riteo Aug 18, 2023
126a6e6
Fix weird libdecor startup crash on SSD compositors
Riteo Aug 19, 2023
25b5702
Implement animated cursors
Riteo Aug 19, 2023
8a6aba5
Implement cursor HiDPI
Riteo Aug 19, 2023
b563f72
Fix pasting into some clients such as firefox
Riteo Aug 19, 2023
221513a
Lock the mutex also for the unconditional dispatch
Riteo Aug 20, 2023
5bdcbe4
wl_pointer: check surface ownership
Riteo Aug 21, 2023
a5cfc11
update wayland-protocols to 1.32
Riteo Aug 21, 2023
1d89ecb
Implement fractional scaling
Riteo Aug 23, 2023
dc3a3bb
Fix spelling issue
Riteo Aug 23, 2023
41e6a06
Add more logging in window output handling
Riteo Aug 29, 2023
c10c26c
Merge commit '549fcce5f8f7beace3e5c90e9bbe4335d4fd1476' into wayland
Riteo Sep 1, 2023
a1d4eac
Label outputs as our own
Riteo Sep 12, 2023
b61f166
Merge commit 'e3e2528ba7f6e85ac167d687dd6312b35f558591' of https://gi…
Riteo Sep 19, 2023
acbeae6
Avoid error spam with missing cursors
Riteo Sep 19, 2023
3793926
Use doubles for frac scale and add note regarding godot->wayland
Riteo Sep 20, 2023
79263c4
Make data handling type agnostic
Riteo Sep 20, 2023
9042008
Merge commit '901e090e567bd425b84bf18fe773a3f0f641c42c' into wayland
Riteo Sep 22, 2023
be62fd3
Merge commit '1887a9df19ea689bfb69f55454f0598bd09ab95f' into wayland
Riteo Sep 22, 2023
0076742
Merge branch 'master' of https://github.com/godotengine/godot into wa…
Riteo Sep 22, 2023
e3c497a
Remove VSync Editor override from EGLManager
Riteo Sep 22, 2023
7d5ceb2
Fix segfault when setting hint while window is unfocused
Riteo Sep 23, 2023
5e0ef34
Remove pre-ANGLE EGL driver include snippet
Riteo Sep 26, 2023
9a44ebe
Style nitpicks
Riteo Sep 26, 2023
99dbd77
Improve warp_mouse comment about it being hacky
Riteo Sep 28, 2023
376b4a6
Handle null cursors properly in cursor update routine
Riteo Sep 29, 2023
ad62a58
Data device: track offered media types and select the best one
Riteo Sep 30, 2023
d6f12b4
Remove useless frame signal reset
Riteo Oct 2, 2023
0fbda91
Merge commit '57a6813bb8bc2417ddef1058d422a91f0c9f753c' of https://gi…
Riteo Oct 4, 2023
4562602
Fix spelling issue
Riteo Oct 4, 2023
4e18629
Clear the custom cursor on destruction and on cursor_set_shape
Riteo Oct 4, 2023
2c66b83
Fix cursor visibility setting
Riteo Oct 4, 2023
92b2987
Calculate mouse delta properly
Riteo Oct 4, 2023
91ec250
Implement clipboard_get_image
Riteo Oct 4, 2023
3eea778
Prioritize the most common formats in clipboard_get_image
Riteo Oct 4, 2023
b1b0675
Unify DnD offer reading logic
Riteo Oct 6, 2023
cdb0a43
Initial work on DRI_PRIME detection
Riteo Oct 6, 2023
8e6834e
Fix copyright headers
Riteo Oct 9, 2023
5a99ad6
Make PRIME detection use the actual GPU index instead of maxing to 1
Riteo Oct 9, 2023
702b8b5
Begin adding some Wayland info in the documentation
Riteo Oct 12, 2023
568d5b7
Merge commit 'b1371806ad3907c009458ea939bd4b810f9deb21' of https://gi…
Riteo Oct 13, 2023
cfd9c5b
Use vararg call in DisplayServerWayland
Riteo Oct 13, 2023
9669ab8
Fix vulkan-only build
leandro-benedet-garcia Oct 13, 2023
844f1da
Properly load the default cursor theme
Riteo Oct 13, 2023
286cd18
Fix includes for unwrapped builds
Riteo Oct 18, 2023
75aa752
Improve clipboard handling and fix local copy/paste
Riteo Oct 24, 2023
96ddc68
Merge commit 'e8d57afaeccf0d9f9726746f49936eb93aa0039b' into wayland
Riteo Oct 24, 2023
706f808
Simplify buffer scale calculation and unify window rescaling
Riteo Nov 3, 2023
e82933e
Merge commit '4c96e9676b66d0cc9a25022b019b78f4c20ddc60' of https://gi…
Riteo Nov 10, 2023
8eb1ea2
Merge commit '64150060f89677eaf11229813ae6c5cf8a873802' of https://gi…
Riteo Nov 16, 2023
58c177d
Check for actual window size/scale changes before rescaling
Riteo Nov 18, 2023
31c9fa1
Emit WINDOW_EVENT_DPI_CHANGE on scale change
Riteo Nov 18, 2023
a489c9a
Merge commit 'ad72de508363ca8d10c6b148be44a02cdf12be13' of https://gi…
Riteo Nov 18, 2023
e502685
fix vformat which break event propagation and break cursor size
stalkerg Nov 18, 2023
fc8a1d3
fix doubled enable hover mode
stalkerg Nov 18, 2023
e71b341
Merge pull request #3 from stalkerg/cursor-and-input-bugfix
Riteo Nov 19, 2023
3d49d4e
Fix build
Riteo Nov 19, 2023
8e60678
Remove weird X11 quirk handling
Riteo Nov 19, 2023
fdff1de
Check for proxy before checking ownership
Riteo Nov 22, 2023
01e2890
scaling: resize on preferred scale when possible
Riteo Nov 25, 2023
d8e8062
Merge commit '1ba920fada9efc8c4476ded50fe673b8db541366' of https://gi…
Riteo Nov 25, 2023
5083af1
Fix libdecor-less fallback when the decoration manager is missing
Riteo Nov 27, 2023
b1936cf
Make all methods starting with an undescore actually private
Riteo Nov 28, 2023
0bf1295
Bump version to 4.2.1-rc
akien-mga Nov 29, 2023
185fc1c
Merge tag '4.2-stable' of https://github.com/godotengine/godot into w…
Riteo Nov 30, 2023
ab7b662
Fix SubViewport physics picking for 4.2
Sauermann Dec 2, 2023
013c119
Fix crash when using incompatible versions of Godot Jolt
mihe Dec 5, 2023
17888fb
Merge pull request #85779 from mihe/godot-jolt-crash
YuriSizov Dec 5, 2023
289472d
Merge pull request #85665 from Sauermann/fix-4.2-subviewport-physics-…
akien-mga Dec 5, 2023
8a38518
Remove unnecessary uses of `CharString`'s `ptr` and `ptrw`
Riteo Dec 5, 2023
32128e0
HiDPI: track all screens
Riteo Dec 6, 2023
0c97e92
Defer buffer scale setting to avoid invalid buffer combinations
Riteo Dec 6, 2023
32d7f03
Remove useless window commits
Riteo Dec 6, 2023
efe3793
Comment out tablet support
Riteo Dec 7, 2023
c8b0bc6
Improve comments behind frame commit magic thing
Riteo Dec 7, 2023
8d9d58b
Automatically ensure correct normals in Compatibility renderer
BlueCube3310 Oct 4, 2023
54c799f
Improve and clarify texture filtering documentation
Calinou Oct 24, 2023
a813176
Fix buffer updates going to the wrong cmd buffer if barriers were 0
darksylinc Oct 21, 2023
0478c7c
Enable scrolling of output with UI scale changes
RoyBerube Nov 6, 2023
ffe9358
Fix UV editor not using texture transform
aXu-AP Oct 27, 2023
5c709cf
Fix missing NavigationObstacle property updates in constructor
smix8 Oct 23, 2023
ece0c0c
Fix missing NavigationAgent property updates in constructor
smix8 Oct 23, 2023
dfcfc79
Fix missing NavigationRegion property updates in constructor
smix8 Oct 23, 2023
fc7cc46
Fix missing NavigationLink property updates in constructor
smix8 Oct 22, 2023
bd2cad5
Comment the shader template light function by default
reduz Nov 7, 2023
dbb86ed
Fix generating terrain icon with certain image formats.
SaracenOne Nov 6, 2023
2cbe02a
Add shadows_disabled macro in Compatibility renderer
jsjtxietian Nov 7, 2023
b768561
Fix bad parameter of rendering_method crashes Godot
jsjtxietian Oct 31, 2023
e4aec48
VideoPlayer: Fix reloading translation remapped stream
akien-mga Nov 12, 2023
c913a8d
Fix memory leak in 'NavigationServer3D' involving static obstacles
Scony Nov 12, 2023
7b9bf3d
Fix imported track flag on sliced animations.
SaracenOne Nov 18, 2023
90f7b2b
Fix NavigationRegion2D transform update
smix8 Nov 23, 2023
779414c
Fix memory leak on error paths in tinyexr loader
alesliehughes Nov 16, 2023
1d82ae2
Remove unused grip touch action from default OpenXR action map
BastiaanOlij Nov 18, 2023
f84ee53
Only allow MeshInstance3D-based nodes in particles emission shape nod…
Calinou Nov 14, 2023
7fb0ec0
Only allow MeshInstance3D-inherited nodes in MultiMesh Populate Surfa…
Calinou Nov 15, 2023
4ddcfb5
Fix issue with 3D scene drag and drop preview node
EelisOtsamo Nov 19, 2023
b642489
Fixed reading WAV files with odd chunk sizes.
bs-mwoerner Dec 4, 2023
cff941f
Fix typo in BaseMaterial3D conversion from 3.x SpatialMaterial
Calinou Nov 23, 2023
2786f0e
Prevent a crash when calling AnimationMixer::restore when an invalid …
jsjtxietian Nov 28, 2023
cc9bb3b
Do not consume (eat) mouse messages with no_focus Window's (Godot Pop…
Maran23 Nov 28, 2023
3ba731f
[RTL] Fix CharFX character offset calculation.
bruvzg Nov 25, 2023
d2d7261
Set ReflectionProbe frame before mapping id in mobile renderer
clayjohn Dec 1, 2023
871d00c
Fix AnimationPlayer seeking for Discrete keys
TokageItLab Nov 30, 2023
1fcf635
Limit window size updates on title change.
bruvzg Nov 30, 2023
492b0c3
Fix Tween loop initial value
KoBeWi Dec 2, 2023
5181638
Fix memory corruption and assert failures in convex decomposition
Malcolmnixon Dec 1, 2023
6cfe17c
[Core] Prevent infinite recursion when printing errors
AThousandShips Nov 26, 2023
b5e7b2c
[Core] Fix crash when hashing empty `CharString`
AThousandShips Nov 26, 2023
77383e6
Keep scene tiles even if the TileMap is invisible
groud Dec 4, 2023
21a510b
Restored Control layout properties you undo a parenting of a Control …
TheSofox Nov 21, 2023
dc221c5
use venv if detected when building godot.sln
brno32 Nov 7, 2023
a207e53
Fix order of operations for macos template check
brno32 Nov 16, 2023
4564a85
Correctly check scripts that must inherit `EditorPlugin`
YuriSizov Nov 23, 2023
dc5d477
Fix the Web platform team's codeowners link
YuriSizov Dec 4, 2023
d93fcf8
Fix theme application in various editor dialogs
YuriSizov Dec 4, 2023
bca878f
Use vertex input mask for creating vertex arrays
clayjohn Nov 19, 2023
836e018
Add a descriptive error message when creating a mesh surface from arrays
aaronfranke Dec 2, 2023
bd7d37b
Fix errors on file rename or move in the Filesystem Dock
Jordyfel Nov 6, 2023
6e4a7ee
Vulkan: Fix incorrect access to the buffers on Android
Alex2782 Nov 13, 2023
bcf09f1
Remove exp hint of a few properties
MewPurPur Aug 6, 2023
476bc36
Allow dragging editable children
timothyqiu Nov 1, 2023
2b3a8f0
Update cached singletons when reloading GDScripts
DmitriySalnikov Nov 26, 2023
3dfb82f
Fix IME key event being erased in macOS
HolySkyMin Nov 28, 2023
1d5f6ed
Improve documentation for `CameraAttributesPhysical.exposure_shutter_…
addmix Dec 1, 2023
b959ab9
Fix property groups overriding real properties
paulloz Nov 28, 2023
0ba32ac
Filter groups and categories from autocompletion
HolonProduction Nov 21, 2023
6f8cc1b
Improve autocompletion with get_node
HolonProduction Jul 12, 2023
5db5f0b
Set language encoding flag when using ZIPPacker
timothyqiu Jun 27, 2023
d25e28d
Inspector: Fix clearing array/dictionary element with `<Object#null>`
dalexeev Oct 31, 2023
511b4f8
Make sure `Window`'s title is respected before we compute the size
YuriSizov Nov 24, 2023
24a383e
X11: Send IME update notification deferred
HolonProduction Nov 24, 2023
65677df
[iOS] Use mdfind to check if Xcode is installed in one-click deploy c…
bruvzg Dec 5, 2023
455e8f0
[macOS] Switch ANGLE backend to ANGLE over OpenGL, switch default com…
bruvzg Dec 5, 2023
2167526
Fix SnapGrid is almost invisble in light theme
jsjtxietian Dec 1, 2023
351bede
Fix UV editor not showing polygon correctly
aXu-AP Oct 28, 2023
83d3ccc
fix documentation for `icon_and_font_color` editor setting
BNTFryingPan Nov 29, 2023
d29aaed
Limit window size updates on title translation change.
bruvzg Dec 6, 2023
4cadc50
Do not reload resources and send notification if locale is not changed.
bruvzg Dec 5, 2023
7931c04
Fix size and visuals of the InputEventConfigurationDialog
YuriSizov Dec 5, 2023
c219ffe
Fix invalid Python escape sequences
emklasson Dec 6, 2023
075a5a1
Fix missing heading in translated online class reference
timothyqiu Dec 7, 2023
9d22668
Merge pull request #85784 from YuriSizov/4.2-cherrypicks
akien-mga Dec 7, 2023
daeb1c7
i18n: Sync translations with Weblate
akien-mga Dec 7, 2023
ae0e07b
Force highest known buffer scale and update it only if necessary
Riteo Dec 7, 2023
90f75c9
Remove dumb comment and make a variable name more consistent
Riteo Dec 7, 2023
c9f473b
Fix typo
Riteo Dec 7, 2023
9787915
Make `_show_window` actually private
Riteo Dec 7, 2023
6aeb2a6
Fix broken lazy scale logic
Riteo Dec 10, 2023
6e043b8
Fixes TileMap occluders
groud Dec 7, 2023
4cce0d9
Ensure that 2D meshes use a proper input mask
clayjohn Dec 9, 2023
fc15ffe
GLES3: Skip batches with zero instance count while rendering
HolySkyMin Dec 5, 2023
ed55f9d
Update the changelog for 4.2.1
YuriSizov Dec 11, 2023
67038ec
Merge pull request #86026 from YuriSizov/4.2-cherrypicks
YuriSizov Dec 11, 2023
5dd7623
Set what were default values for some emscripten linkflags
adamscott Dec 11, 2023
1dee633
i18n: Sync translations with Weblate
akien-mga Dec 11, 2023
b09f793
Bump version to 4.2.1-stable
akien-mga Dec 11, 2023
27c4989
Merge tag '4.2.1-stable' of https://github.com/godotengine/godot into…
Riteo Dec 14, 2023
9b19435
I completely forgot 4.2.1 was in a different branch
Riteo Dec 14, 2023
091c4a2
Unlock the wl thread before flushing inputs
Riteo Dec 14, 2023
f992a23
Remove unused XKB key mappers
Riteo Dec 14, 2023
b25b842
Add attribution for wayland and wayland-protocols
Riteo Dec 15, 2023
868058a
Fix typo in COPYRIGHT.txt
Riteo Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ jobs:
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu focal main"
sudo apt-get install -qq mesa-vulkan-drivers

# TODO: Figure out somehow how to embed this one.
- name: wayland-scanner dependency
run: |
sudo apt-get install libwayland-bin

- name: Free disk space on runner
run: |
echo "Disk usage before:" && df -h
Expand Down
20 changes: 20 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,26 @@ Comment: Vulkan Memory Allocator
Copyright: 2017-2021, Advanced Micro Devices, Inc.
License: Expat

Files: ./thirdparty/wayland/
Comment: Wayland core protocol
Copyright: 2008-2012, Kristian Høgsberg
2010-2012, Intel Corporation
2011, Benjamin Franzke
2012, Collabora, Ltd.
License: Expat

Files: ./thirdparty/wayland-protocols/
Comment: Wayland protocols that add functionality not available in the core protocol
Copyright: 2008-2013, Kristian Høgsberg
2010-2013, Intel Corporation
2013, Rafael Antognolli
2013, Jasper St. Pierre
2014, Jonas Ådahl
2014, Jason Ekstrand
2014-2015, Collabora, Ltd.
2015, Red Hat Inc.
License: Expat

Files: ./thirdparty/wslay/
Comment: Wslay
Copyright: 2011, 2012, 2015, Tatsuhiro Tsujikawa
Expand Down
88 changes: 47 additions & 41 deletions doc/classes/DisplayServer.xml

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions drivers/vulkan/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ if env["platform"] == "android":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_ANDROID_KHR"])
elif env["platform"] == "ios":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_IOS_MVK"])
elif env["platform"] == "linuxbsd" and env["x11"]:
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_XLIB_KHR"])
elif env["platform"] == "linuxbsd":
if env["x11"]:
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_XLIB_KHR"])
if env["wayland"]:
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_WAYLAND_KHR"])
elif env["platform"] == "macos":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_MACOS_MVK"])
elif env["platform"] == "windows":
Expand Down
6 changes: 6 additions & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,12 @@ String EditorSettings::get_editor_layouts_config() const {
}

float EditorSettings::get_auto_display_scale() const {
#ifdef LINUXBSD_ENABLED
if (DisplayServer::get_singleton()->get_name() == "Wayland") {
return DisplayServer::get_singleton()->screen_get_max_scale();
}
#endif

#if defined(MACOS_ENABLED) || defined(ANDROID_ENABLED)
return DisplayServer::get_singleton()->screen_get_max_scale();
#else
Expand Down
6 changes: 5 additions & 1 deletion modules/openxr/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ elif env["platform"] == "linuxbsd":
if env["x11"]:
env_openxr.AppendUnique(CPPDEFINES=["XR_USE_PLATFORM_XLIB"])

if env["wayland"]:
env_openxr.AppendUnique(CPPDEFINES=["XR_USE_PLATFORM_WAYLAND"])

# FIXME: Review what needs to be set for Android and macOS.
env_openxr.AppendUnique(CPPDEFINES=["HAVE_SECURE_GETENV"])
elif env["platform"] == "windows":
Expand Down Expand Up @@ -101,7 +104,8 @@ if env["platform"] == "android":
env_openxr.add_source_files(module_obj, "extensions/openxr_android_extension.cpp")
if env["vulkan"]:
env_openxr.add_source_files(module_obj, "extensions/openxr_vulkan_extension.cpp")
if env["opengl3"] and env["platform"] != "macos":
if env["opengl3"] and (env["platform"] != "linuxbsd" or env["x11"]) and env["platform"] != "macos":
# On Linux/BSD, the OpenGL extension should only be enabled when at least X11 is enabled.
env_openxr.add_source_files(module_obj, "extensions/openxr_opengl_extension.cpp")

env_openxr.add_source_files(module_obj, "extensions/openxr_palm_pose_extension.cpp")
Expand Down
8 changes: 6 additions & 2 deletions modules/openxr/extensions/openxr_opengl_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ bool OpenXROpenGLExtension::check_graphics_api_support(XrVersion p_desired_versi
XrGraphicsBindingOpenGLWin32KHR OpenXROpenGLExtension::graphics_binding_gl;
#elif ANDROID_ENABLED
XrGraphicsBindingOpenGLESAndroidKHR OpenXROpenGLExtension::graphics_binding_gl;
#else
#elif X11_ENABLED
XrGraphicsBindingOpenGLXlibKHR OpenXROpenGLExtension::graphics_binding_gl;
#endif

Expand All @@ -147,6 +147,10 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex

DisplayServer *display_server = DisplayServer::get_singleton();

#ifdef WAYLAND_ENABLED
ERR_FAIL_COND_V_MSG(display_server->get_name() == "Wayland", p_next_pointer, "OpenXR is not yet supported on OpenGL Wayland.");
#endif

#ifdef WIN32
graphics_binding_gl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR,
graphics_binding_gl.next = p_next_pointer;
Expand All @@ -160,7 +164,7 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex
graphics_binding_gl.display = (void *)display_server->window_get_native_handle(DisplayServer::DISPLAY_HANDLE);
graphics_binding_gl.config = (EGLConfig)0; // https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/src/tests/hello_xr/graphicsplugin_opengles.cpp#L122
graphics_binding_gl.context = (void *)display_server->window_get_native_handle(DisplayServer::OPENGL_CONTEXT);
#else
#elif X11_ENABLED
graphics_binding_gl.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR;
graphics_binding_gl.next = p_next_pointer;

Expand Down
5 changes: 5 additions & 0 deletions platform/linuxbsd/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Import("env")
from platform_methods import run_in_subprocess
import platform_linuxbsd_builders

thirdparty_dir = "#thirdparty"

common_linuxbsd = [
"crash_handler_linuxbsd.cpp",
"os_linuxbsd.cpp",
Expand All @@ -19,6 +21,9 @@ if env["use_sowrap"]:
if env["x11"]:
common_linuxbsd += SConscript("x11/SCsub")

if env["wayland"]:
common_linuxbsd += SConscript("wayland/SCsub")

if env["speechd"]:
common_linuxbsd.append("tts_linux.cpp")
if env["use_sowrap"]:
Expand Down
43 changes: 40 additions & 3 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def get_opts():
BoolVariable("fontconfig", "Use fontconfig for system fonts support", True),
BoolVariable("udev", "Use udev for gamepad connection callbacks", True),
BoolVariable("x11", "Enable X11 display", True),
BoolVariable("wayland", "Enable Wayland display", True),
BoolVariable("libdecor", "Enable libdecor support", True),
BoolVariable("touch", "Enable touch events", True),
BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", False),
]
Expand Down Expand Up @@ -204,6 +206,11 @@ def configure(env: "Environment"):
if env["use_sowrap"]:
env.Append(CPPDEFINES=["SOWRAP_ENABLED"])

if env["wayland"]:
if os.system("wayland-scanner -v") != 0:
print("wayland-scanner not found. Aborting.")
exit(255)

if env["touch"]:
env.Append(CPPDEFINES=["TOUCH_ENABLED"])

Expand Down Expand Up @@ -364,9 +371,12 @@ def configure(env: "Environment"):
env.ParseConfig("pkg-config xkbcommon --cflags --libs")
env.Append(CPPDEFINES=["XKB_ENABLED"])
else:
print(
"Warning: libxkbcommon development libraries not found. Disabling dead key composition and key label support."
)
if env["wayland"]:
print("Error: libxkbcommon development libraries required by Wayland not found. Aborting.")
else:
print(
"Warning: libxkbcommon development libraries not found. Disabling dead key composition and key label support."
)
else:
env.Append(CPPDEFINES=["XKB_ENABLED"])

Expand Down Expand Up @@ -433,6 +443,33 @@ def configure(env: "Environment"):
env.ParseConfig("pkg-config xi --cflags --libs")
env.Append(CPPDEFINES=["X11_ENABLED"])

if env["wayland"]:
if not env["use_sowrap"]:
if os.system("pkg-config --exists libdecor-0"):
print("Warning: libdecor development libraries not found. Disabling client-side decorations.")
env["libdecor"] = False
else:
env.ParseConfig("pkg-config libdecor-0 --cflags --libs")
if os.system("pkg-config --exists wayland-client"):
print("Error: Wayland client library not found. Aborting.")
sys.exit(255)
env.ParseConfig("pkg-config wayland-client --cflags --libs")
if os.system("pkg-config --exists wayland-cursor"):
print("Error: Wayland cursor library not found. Aborting.")
sys.exit(255)
env.ParseConfig("pkg-config wayland-cursor --cflags --libs")
if os.system("pkg-config --exists wayland-egl"):
print("Error: Wayland EGL library not found. Aborting.")
sys.exit(255)
env.ParseConfig("pkg-config wayland-egl --cflags --libs")

if env["libdecor"]:
env.Append(CPPDEFINES=["LIBDECOR_ENABLED"])

env.Prepend(CPPPATH=["#platform/linuxbsd", "#thirdparty/linuxbsd_headers/wayland/"])
env.Append(CPPDEFINES=["WAYLAND_ENABLED"])
env.Append(LIBS=["rt"]) # Needed by glibc, used by _allocate_shm_file

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
if not env["use_volk"]:
Expand Down
2 changes: 1 addition & 1 deletion platform/linuxbsd/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void register_linuxbsd_exporter_types() {
void register_linuxbsd_exporter() {
Ref<EditorExportPlatformLinuxBSD> platform;
platform.instantiate();
platform->set_name("Linux/X11");
platform->set_name("Linux/X11/Wayland");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it now be better to just call the platform "Linux"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamscott not sure, as the display server is a pretty important information, although now it's probably not as important as when we had only X11.

If we had to rename it I'd go for "Linux/BSD", as it's actually also supposed to support BSD (and it probably unofficially supports other *nixes)

platform->set_os_name("Linux");
platform->set_chmod_flags(0755);

Expand Down
16 changes: 16 additions & 0 deletions platform/linuxbsd/os_linuxbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -1162,6 +1174,10 @@ OS_LinuxBSD::OS_LinuxBSD() {
AudioDriverManager::add_driver(&driver_alsa);
#endif

#ifdef WAYLAND_ENABLED
DisplayServerWayland::register_wayland_driver();
#endif

#ifdef X11_ENABLED
DisplayServerX11::register_x11_driver();
#endif
Expand Down
2 changes: 2 additions & 0 deletions platform/linuxbsd/os_linuxbsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class OS_LinuxBSD : public OS_Unix {

virtual void alert(const String &p_alert, const String &p_title = "ALERT!") override;

virtual int get_low_processor_usage_mode_sleep_usec() const override;

virtual bool _check_internal_feature_support(const String &p_feature) override;

void run();
Expand Down
Loading
Loading