diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index a2e8dcc53c..6df28fa369 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -382,9 +382,13 @@ public: auto surface = keyboard->focusedSurface(); ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection(); + if (!xwaylandClient) { + return; + } + if (surface) { ClientConnection *client = surface->client(); - if (xwaylandClient && xwaylandClient == client) { + if (xwaylandClient == client) { return; } }