Send current primary selection after introducing focused surface

Toolkits such as GTK don't like that kwin sends the current primary
selection before the wl_keyboard.enter event.
This commit is contained in:
Vlad Zahorodnii 2021-03-29 20:27:42 +03:00
parent 4a357d503e
commit daadaa70de

View file

@ -916,6 +916,9 @@ void SeatInterface::setFocusedKeyboardSurface(SurfaceInterface *surface)
}
d->globalKeyboard.focus = SeatInterfacePrivate::Keyboard::Focus();
d->globalKeyboard.focus.surface = surface;
d->keyboard->setFocusedSurface(surface, serial);
if (d->globalKeyboard.focus.surface) {
d->globalKeyboard.focus.destroyConnection = connect(surface, &QObject::destroyed, this, [this]() {
d->globalKeyboard.focus = SeatInterfacePrivate::Keyboard::Focus();
@ -949,8 +952,6 @@ void SeatInterface::setFocusedKeyboardSurface(SurfaceInterface *surface)
}
}
d->keyboard->setFocusedSurface(surface, serial);
// focused text input surface follows keyboard
if (hasKeyboard()) {
setFocusedTextInputSurface(surface);