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

Wayland: Commit surface on window creation #94402

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

Riteo
Copy link
Contributor

@Riteo Riteo commented Jul 15, 2024

Fixes #94204.
Possible regression from #93684.

This is needed for initializing xdg_surfaces when not using libdecor. Now the pure xdg_shell code path should work again.

This is needed for initializing xdg_surfaces when not using libdecor.
Now the pure xdg_shell code path should work again.
@em-s-h
Copy link

em-s-h commented Jul 15, 2024

Hi, I tried to compile this to test if #94204 had been fixed but I got this error during compilation.

[Initial build] Compiling thirdparty/glad/gl.c ...
In file included from thirdparty/vulkan/vk_mem_alloc.cpp:7:
thirdparty/vulkan/vk_mem_alloc.h: In function 'void VmaUint32ToStr(char*, size_t, uint32_t)':
thirdparty/vulkan/vk_mem_alloc.h:2821:9: error: 'snprintf' was not declared in this scope
 2821 |         snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
      |         ^~~~~~~~
thirdparty/vulkan/vk_mem_alloc.h:2655:1: note: 'snprintf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
 2654 |     #include <mutex>
  +++ |+#include <cstdio>
 2655 | #else
thirdparty/vulkan/vk_mem_alloc.h: In function 'void VmaUint64ToStr(char*, size_t, uint64_t)':
thirdparty/vulkan/vk_mem_alloc.h:2825:9: error: 'snprintf' was not declared in this scope
 2825 |         snprintf(outStr, strLen, "%llu", static_cast<unsigned long long>(num));
      |         ^~~~~~~~
thirdparty/vulkan/vk_mem_alloc.h:2825:9: note: 'snprintf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
thirdparty/vulkan/vk_mem_alloc.h: In function 'void VmaPtrToStr(char*, size_t, const void*)':
thirdparty/vulkan/vk_mem_alloc.h:2829:9: error: 'snprintf' was not declared in this scope
 2829 |         snprintf(outStr, strLen, "%p", ptr);
      |         ^~~~~~~~
thirdparty/vulkan/vk_mem_alloc.h:2829:9: note: 'snprintf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
scons: *** [thirdparty/vulkan/vk_mem_alloc.linuxbsd.editor.x86_64.o] Error 1
In file included from ./core/os/thread.h:42,
                 from drivers/alsa/audio_driver_alsa.h:37,
                 from drivers/alsa/audio_driver_alsa.cpp:31:
./core/templates/safe_refcount.h:135:49: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  135 |         _ALWAYS_INLINE_ explicit SafeNumeric<T>(T p_value = static_cast<T>(0)) {
      |                                                 ^
./core/templates/safe_refcount.h:135:49: note: remove the '< >'
In file included from ./core/os/thread.h:42,
                 from drivers/pulseaudio/audio_driver_pulseaudio.h:37,
                 from drivers/pulseaudio/audio_driver_pulseaudio.cpp:31:
./core/templates/safe_refcount.h:135:49: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  135 |         _ALWAYS_INLINE_ explicit SafeNumeric<T>(T p_value = static_cast<T>(0)) {
      |                                                 ^
./core/templates/safe_refcount.h:135:49: note: remove the '< >'
scons: building terminated because of errors.
[Time elapsed: 00:20:59.712]

@Riteo
Copy link
Contributor Author

Riteo commented Jul 15, 2024

@em-s-h that's quite baffling, the patch is a function call and an empty line...

Have you cherry-picked the change or something like that? Could you try doing a hard reset to this branch and doing a git clean -fdx (NOTE: it will delete everything "foreign" to the repo, including custom.py!)

@em-s-h
Copy link

em-s-h commented Jul 15, 2024

Have you cherry-picked the change or something like that?

No, I simply cloned your fork and tried to build using the aur PKGBUILD script, although after reading the Godot documentation on compiling for linux it says that LTO (the default on the script) requires 7GB of ram while I only have 4, so could that cause this issue?

@Riteo
Copy link
Contributor Author

Riteo commented Jul 15, 2024

@em-s-h The PKGBUILD will very probably try building the master branch of my fork, which is terribly outdated. You will have to switch to my branch (committed-to-the-cause), although I recommend to just build it manually, which isn't that hard.

Supposing you have all dependencies, once switched into the branch, a plain scons invocation should work fine.

Regarding the LTO thing, yeah 4 GBs is nothing, as it's extremely resource intensive and, since you're just testing a bugfix, I would not bother using it at all.

@BasilYes
Copy link

Patch work for me

@em-s-h
Copy link

em-s-h commented Jul 16, 2024

I can also confirm that the patch works.

@Riteo
Copy link
Contributor Author

Riteo commented Jul 16, 2024

Thank you folks for testing!

@akien-mga akien-mga changed the title Wayland: commit surface on window creation Wayland: Commit surface on window creation Jul 17, 2024
@akien-mga akien-mga merged commit d191bee into godotengine:master Jul 17, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wayland: Godot v4.3 beta3 crashes when running on linux
4 participants