Changeset View
Changeset View
Standalone View
Standalone View
keyboard_input.cpp
Show First 20 Lines • Show All 368 Lines • ▼ Show 20 Line(s) | |||||
369 | 369 | | |||
370 | void KeyboardInputRedirection::init() | 370 | void KeyboardInputRedirection::init() | ||
371 | { | 371 | { | ||
372 | Q_ASSERT(!m_inited); | 372 | Q_ASSERT(!m_inited); | ||
373 | m_inited = true; | 373 | m_inited = true; | ||
374 | 374 | | |||
375 | connect(workspace(), &QObject::destroyed, this, [this] { m_inited = false; }); | 375 | connect(workspace(), &QObject::destroyed, this, [this] { m_inited = false; }); | ||
376 | connect(waylandServer(), &QObject::destroyed, this, [this] { m_inited = false; }); | 376 | connect(waylandServer(), &QObject::destroyed, this, [this] { m_inited = false; }); | ||
377 | connect(workspace(), &Workspace::clientActivated, this, &KeyboardInputRedirection::update); | 377 | connect(workspace(), &Workspace::clientActivated, this, | ||
378 | [this] { | ||||
379 | disconnect(m_activeClientSurfaceChangedConnection); | ||||
380 | if (auto c = workspace()->activeClient()) { | ||||
381 | m_activeClientSurfaceChangedConnection = connect(c, &Toplevel::surfaceChanged, this, &KeyboardInputRedirection::update); | ||||
382 | } else { | ||||
383 | m_activeClientSurfaceChangedConnection = QMetaObject::Connection(); | ||||
384 | } | ||||
385 | update(); | ||||
386 | } | ||||
387 | ); | ||||
378 | if (waylandServer()->hasScreenLockerIntegration()) { | 388 | if (waylandServer()->hasScreenLockerIntegration()) { | ||
379 | connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged, this, &KeyboardInputRedirection::update); | 389 | connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged, this, &KeyboardInputRedirection::update); | ||
380 | } | 390 | } | ||
381 | 391 | | |||
382 | QAction *switchKeyboardAction = new QAction(this); | 392 | QAction *switchKeyboardAction = new QAction(this); | ||
383 | switchKeyboardAction->setObjectName(QStringLiteral("Switch to Next Keyboard Layout")); | 393 | switchKeyboardAction->setObjectName(QStringLiteral("Switch to Next Keyboard Layout")); | ||
384 | switchKeyboardAction->setProperty("componentName", QStringLiteral("KDE Keyboard Layout Switcher")); | 394 | switchKeyboardAction->setProperty("componentName", QStringLiteral("KDE Keyboard Layout Switcher")); | ||
385 | const QKeySequence sequence = QKeySequence(Qt::ALT+Qt::CTRL+Qt::Key_K); | 395 | const QKeySequence sequence = QKeySequence(Qt::ALT+Qt::CTRL+Qt::Key_K); | ||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |