Make it easier to debug the virtualkeyboard
Summary: Provide the important debug messages which can be used to debug why virtualkeyboard is not starting. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D17454
This commit is contained in:
parent
16e904592a
commit
533f43ad02
4 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
kwin_core KWin Core DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWIN_CORE]
|
||||
kwin_virtualkeyboard KWin Virtual Keyboard Integration DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWIN_VIRTUALKEYBOARD]
|
||||
kwineffects KWin Effects DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWINEFFECTS]
|
||||
libkwineffects KWin Effects Library DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [LIBKWINEFFECTS]
|
||||
libkwinglutils KWin OpenGL utility Library DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [LIBKWINGLUTILS]
|
||||
|
|
|
@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#endif
|
||||
|
||||
Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg)
|
||||
Q_LOGGING_CATEGORY(KWIN_VIRTUALKEYBOARD, "kwin_virtualkeyboard", QtCriticalMsg)
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
|
1
utils.h
1
utils.h
|
@ -39,6 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// system
|
||||
#include <limits.h>
|
||||
Q_DECLARE_LOGGING_CATEGORY(KWIN_CORE)
|
||||
Q_DECLARE_LOGGING_CATEGORY(KWIN_VIRTUALKEYBOARD)
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
|
|
@ -68,12 +68,14 @@ VirtualKeyboard::~VirtualKeyboard() = default;
|
|||
void VirtualKeyboard::init()
|
||||
{
|
||||
// TODO: need a shared Qml engine
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "Initializing window";
|
||||
m_inputWindow.reset(new QQuickView(nullptr));
|
||||
m_inputWindow->setFlags(Qt::FramelessWindowHint);
|
||||
m_inputWindow->setGeometry(screens()->geometry(screens()->current()));
|
||||
m_inputWindow->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||
m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main.qml"))));
|
||||
if (m_inputWindow->status() != QQuickView::Status::Ready) {
|
||||
qCWarning(KWIN_VIRTUALKEYBOARD) << "window not ready yet";
|
||||
m_inputWindow.reset();
|
||||
return;
|
||||
}
|
||||
|
@ -81,13 +83,16 @@ void VirtualKeyboard::init()
|
|||
|
||||
if (waylandServer()) {
|
||||
m_enabled = !input()->hasAlphaNumericKeyboard();
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "enabled by default: " << m_enabled;
|
||||
connect(input(), &InputRedirection::hasAlphaNumericKeyboardChanged, this,
|
||||
[this] (bool set) {
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "AlphaNumeric Keyboard changed:" << set << "toggling VirtualKeyboard.";
|
||||
setEnabled(!set);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the SNI";
|
||||
m_sni = new KStatusNotifierItem(QStringLiteral("kwin-virtual-keyboard"), this);
|
||||
m_sni->setStandardActionsEnabled(false);
|
||||
m_sni->setCategory(KStatusNotifierItem::Hardware);
|
||||
|
@ -102,6 +107,7 @@ void VirtualKeyboard::init()
|
|||
connect(this, &VirtualKeyboard::enabledChanged, this, &VirtualKeyboard::updateSni);
|
||||
|
||||
auto dbus = new VirtualKeyboardDBus(this);
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the DBus interface";
|
||||
dbus->setEnabled(m_enabled);
|
||||
connect(dbus, &VirtualKeyboardDBus::activateRequested, this, &VirtualKeyboard::setEnabled);
|
||||
connect(this, &VirtualKeyboard::enabledChanged, dbus, &VirtualKeyboardDBus::setEnabled);
|
||||
|
|
Loading…
Reference in a new issue