From daadaa70de07519c8d10dbf5357a061c70d04429 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 29 Mar 2021 20:27:42 +0300 Subject: [PATCH] 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. --- src/wayland/seat_interface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wayland/seat_interface.cpp b/src/wayland/seat_interface.cpp index 9508ecc222..8125e91520 100644 --- a/src/wayland/seat_interface.cpp +++ b/src/wayland/seat_interface.cpp @@ -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);