mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 14:49:44 -09:00
SDDM 0.21 still runs its greeter on X11 and sets
QT_IM_MODULE=qtvirtualkeyboard, but since b1eed7f7 the theme only forwards
to Keyboards.KWinVirtualKeyboard, which only exists under a running KWin.
Qt Virtual Keyboard stays loaded as the input method, and because the theme
no longer instantiates its input panel, Qt creates its own
DesktopInputPanel, which pops up whenever a text field gains focus, a plain
mouse click included. The keyboard button was dead there as well, because
KWinVirtualKeyboard.available is false and its visible property never
becomes true.
Bring the X11 fallback back as a theme-private component: on X11
VirtualKeyboard.qml loads the Qt Virtual Keyboard panel that
plasma-workspace dropped in f1c83d15 (instantiating QtVK.InputPanel is what
keeps Qt from creating its own panel), on Wayland it keeps forwarding to
Keyboards.KWinVirtualKeyboard. The button is hidden when no virtual
keyboard is available at all.
The panel itself carries no animation: it is shown and hidden by animating
the loader that holds it, which slides it below the bottom edge while
fading it out. Keeping the animation in one place matters because Qt
Virtual Keyboard's own hide key turns InputMethod.visible off before the
theme is notified, and a panel that hid itself as soon as it became
inactive would disappear in a single frame instead of sliding out. The
panel is only deactivated once it is fully off-screen, so that hiding it
does not cut the animation short.
BUG: 527138
28 lines
998 B
QML
28 lines
998 B
QML
/*
|
|
SPDX-FileCopyrightText: 2017 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
import QtQuick
|
|
import QtQuick.VirtualKeyboard as QtVK
|
|
|
|
/*
|
|
* Qt Virtual Keyboard's input panel. Instantiating it is what keeps Qt from
|
|
* creating its own DesktopInputPanel, which pops up whenever a text field
|
|
* gains focus, mouse clicks included.
|
|
*
|
|
* The panel has no animation of its own: VirtualKeyboard.qml slides and fades
|
|
* the loader instead. That way the keyboard also animates out when Qt hides
|
|
* the input method on its own, which its built-in hide key does.
|
|
*/
|
|
QtVK.InputPanel {
|
|
id: inputPanel
|
|
property bool activated: false
|
|
active: activated && InputMethod.visible
|
|
// Stay visible while the loader slides the panel off-screen. Hiding it as
|
|
// soon as InputMethod.visible turns false, which Qt Virtual Keyboard's own
|
|
// hide key does, makes the keyboard disappear in a single frame.
|
|
visible: activated
|
|
width: parent.width
|
|
}
|