Skip to content

Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain - #79143

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:wayland-menu
Jul 9, 2023
Merged

Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain#79143
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:wayland-menu

Conversation

@clayjohn

@clayjohn clayjohn commented Jul 7, 2023

Copy link
Copy Markdown
Member

Fixes: #78487
Fixes: #75752

Tested on Windows and Linux (X11), this change does not reintroduce #77790

I am a little uncertain about this change. I am confident that it is minimal and should not cause any problems. But I am unsure if there is an even better fix for the issue. Wayland behaves differently from every other windowing system here, and since I am not running Wayland, it is very difficult to figure out how to make Wayland happy

@deralmas

This comment was marked as outdated.

@deralmas deralmas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for before. I wrote a huge wall of text speculating why this would work when I forgot that I could try on my new shiny desktop wayland setup with xwayland and all bells and whistles.

I can replicate the bug on the aforementioned shiny wayland setup, which is very similar to the one there (arch linux, RDNA2, mesa vulkan radeon) and i confirm that this PR fixes the issue.

As I expected, the branch never gets called (tested with a print_line right after the condition, before free(presentModes);). I think that this fix is somehow related to the fact that we never break from the loop, not the opposite as expected.

That said, this is pretty high priority so I'd merge in the meantime as it indeed fixes the issue.

IMO further investigation is warranted (I can help if you want).

Edit: Rereading the original reasoning behind the patch I might've misunderstood as usual. If the idea was exactly to account for the fact that we never get any null extents in this case... I'm sorry, this stuff is complicated and lately I'm really getting tangled in it.

@akien-mga
akien-mga merged commit 1453dc9 into godotengine:master Jul 9, 2023
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@clayjohn
clayjohn deleted the wayland-menu branch July 9, 2023 11:15
@YuriSizov

Copy link
Copy Markdown
Contributor

Cherry-picked for 4.1.1.

BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain
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.

Godot editor hangs on opening a menu on Linux using wayland [Linux] Upon any file/folder creation inside of Godot; crashes the Hyprland session

4 participants