|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| class | GHOST_WindowWayland |
Macros | |
| #define | USE_EVENT_BACKGROUND_THREAD |
Declaration of GHOST_WindowWayland class.
Definition in file GHOST_WindowWayland.hh.
| #define USE_EVENT_BACKGROUND_THREAD |
Define to workaround for a bug/limitation in WAYLAND, see: #100855 & upstream report: https://gitlab.freedesktop.org/wayland/wayland/-/issues/159
Consume events from WAYLAND in a thread, this is needed because overflowing the event queue causes a fatal error (more than sizeof(wl_buffer.data) at the time of writing).
Solve this using a thread that handles events, locking must be performed as follows:
Lock #GWL_Display.server_mutex to prevent wl_display_dispatch / wl_display_roundtrip running from multiple threads at once.
Even though WAYLAND functions that communicate with wl_display_* have their own locks, GHOST functions that communicate with WAYLAND must use this lock to be thread safe.
Without this reading/writing values such as changing the cursor or setting the window size could conflict with WAYLAND callbacks running in a separate thread. So the server_mutex ensures either GHOST or WAYLAND is manipulating this data, having two WAYLAND callbacks accessing the data at once isn't a problem.
server_mutex, before accessing these functions too.server_mutex results in a dead-lock. In some cases this means the implementation and the public function may need to be split.Definition at line 58 of file GHOST_WindowWayland.hh.