xwayland: Guard against xwyayland connection closing in input spy
The event spy is removed when xwayland closed, but it's based on the process not the wayland socket, so it can be temporarily out of sync. There were no guards for the connection being null. BUG: 471789
This commit is contained in:
parent
f09f5c608d
commit
e93adbee07
1 changed files with 4 additions and 3 deletions
|
@ -157,8 +157,9 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
auto client = surface->client();
|
||||
if (waylandServer()->xWaylandConnection() != client) {
|
||||
KWaylandServer::ClientConnection *client = surface->client();
|
||||
KWaylandServer::ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection();
|
||||
if (xwaylandClient && xwaylandClient != client) {
|
||||
KWaylandServer::KeyboardKeyState state{event->type() == QEvent::KeyPress};
|
||||
if (!updateKey(event->nativeScanCode(), state)) {
|
||||
return;
|
||||
|
@ -170,7 +171,7 @@ public:
|
|||
xkb->modifierState().locked,
|
||||
xkb->currentLayout());
|
||||
|
||||
waylandServer()->seat()->keyboard()->sendKey(event->nativeScanCode(), state, waylandServer()->xWaylandConnection());
|
||||
waylandServer()->seat()->keyboard()->sendKey(event->nativeScanCode(), state, xwaylandClient);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue