Page MenuHome

Fix T100855: Input while Blender is unresponsive exits under Wayland
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Nov 12 2022, 10:00 AM.

Details

Summary

Consume events in a thread to prevent Wayland's event buffer from overflowing and closing the connection.

Details:

  • This is a workaround for a known bug in Wayland [0]. Threaded event handling has been if-defed so it can be removed when it's no longer needed.
  • GTK & QT use threaded event handling to avoid this problem (SDL on the other hand doesn't).
  • The complexity and number of locks needed to handle events in a separate thread is a significant down-side, but as far as I can see this is necessary.
  • Re-connecting to the server is possible but not practical as the OpenGL context is lost and as far as I can tell it's not possible to keep it active (see: D16492).

[0]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/159

Diff Detail

Repository
rB Blender
Branch
TEMP-WAYLAND-EVENT-READ-UPDATE (branched from master)
Build Status
Buildable 24628
Build 24628: arc lint + arc unit

Event Timeline

Closing this patch as I find the solution over complicated, I'd prefer to keep this as a last resort (created the patch for reference).

  • Rename pushEvent_pending -> pushEvent_maybe_pending
Campbell Barton (campbellbarton) retitled this revision from [WIP] GHOST/Wayland: threaded event hanlding to GHOST/Wayland: threaded event hanlding.Nov 14 2022, 9:52 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

Not sure if this is related, just wanted to mention it here. In D13215 I wanted to move event handling to a separate thread so that we can still process some kinds of events even when Blender is doing some processing currently (e.g. evaluating the depsgraph). It worked kinda well on Linux but not on Windows.

Campbell Barton (campbellbarton) retitled this revision from GHOST/Wayland: threaded event hanlding to Fix T100855: Input while Blender is unresponsive exits under Wayland.Nov 15 2022, 5:07 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)