xwayland: Avoid crash if processing keys after xwayland is disconnected

Whilst the XWayland input filter only runs whilst XWayland is running
there is hypothetical window between the wayland connection to xwayland
being disconnected and handleXwaylandFinished, the process exiting. This
should be guarded correctly.

BUG: 480925
This commit is contained in:
David Edmundson 2024-06-03 10:23:57 +00:00
parent 8b843e647c
commit 79ef1be57b

View file

@ -382,9 +382,13 @@ public:
auto surface = keyboard->focusedSurface(); auto surface = keyboard->focusedSurface();
ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection(); ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection();
if (!xwaylandClient) {
return;
}
if (surface) { if (surface) {
ClientConnection *client = surface->client(); ClientConnection *client = surface->client();
if (xwaylandClient && xwaylandClient == client) { if (xwaylandClient == client) {
return; return;
} }
} }