wayland: use mutexes to ensure that MwLLDestroyImpl never conflicts with wayland events.
This commit is contained in:
parent
bed668b84a
commit
a148b3bedf
2 changed files with 86 additions and 8 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include <wayland-client.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include <cairo/cairo.h>
|
||||
#include <pthread.h>
|
||||
|
||||
MWDECL int MwLLWaylandCallInit(void);
|
||||
|
||||
|
|
@ -191,6 +192,12 @@ struct _MwLLWayland {
|
|||
struct _MwLLWaylandShmBuffer cursor;
|
||||
struct _MwLLWaylandShmBuffer* icon;
|
||||
|
||||
/*
|
||||
Events mutex. Any time a keyboard/mouse event happens, we try to lock this for 100 milliseconds, then give up if we can't do it. This is used in conjunction with some code in the MwLLDestroyImpl to make sure that destroy is NEVER interferes with an ongoing event.
|
||||
|
||||
IOI_XD: This sounds like a hilariously rare edge case, so it's almost funnier that this happened with 100% certainty for me and I spent day(s) trying to figure out what was happening. */
|
||||
pthread_mutex_t eventsMutex;
|
||||
|
||||
cairo_surface_t* cs;
|
||||
cairo_t* cairo;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue