Setup touchpad shortcuts and input event filters only on Wayland

They work only on Wayland.
This commit is contained in:
Vlad Zahorodnii 2021-12-01 10:47:03 +02:00
parent 88d423ddcf
commit bf7bdf0be8

View file

@ -2263,9 +2263,10 @@ void InputRedirection::setupWorkspace()
updateLeds(m_keyboard->xkb()->leds()); updateLeds(m_keyboard->xkb()->leds());
connect(m_keyboard, &KeyboardInputRedirection::ledsChanged, this, &InputRedirection::updateLeds); connect(m_keyboard, &KeyboardInputRedirection::ledsChanged, this, &InputRedirection::updateLeds);
setupTouchpadShortcuts();
setupInputFilters();
} }
setupTouchpadShortcuts();
setupInputFilters();
} }
class UserActivitySpy : public InputEventSpy class UserActivitySpy : public InputEventSpy
@ -2419,22 +2420,20 @@ private:
void InputRedirection::setupInputFilters() void InputRedirection::setupInputFilters()
{ {
const bool hasGlobalShortcutSupport = !waylandServer() || waylandServer()->hasGlobalShortcutSupport(); const bool hasGlobalShortcutSupport = waylandServer()->hasGlobalShortcutSupport();
if ((kwinApp()->platform()->session()->capabilities() & Session::Capability::SwitchTerminal) if ((kwinApp()->platform()->session()->capabilities() & Session::Capability::SwitchTerminal)
&& hasGlobalShortcutSupport) { && hasGlobalShortcutSupport) {
installInputEventFilter(new VirtualTerminalFilter); installInputEventFilter(new VirtualTerminalFilter);
} }
if (waylandServer()) { installInputEventSpy(new HideCursorSpy);
installInputEventSpy(new HideCursorSpy); installInputEventSpy(new UserActivitySpy);
installInputEventSpy(new UserActivitySpy); if (hasGlobalShortcutSupport) {
if (hasGlobalShortcutSupport) { installInputEventFilter(new TerminateServerFilter);
installInputEventFilter(new TerminateServerFilter);
}
installInputEventFilter(new DragAndDropInputFilter);
installInputEventFilter(new LockScreenFilter);
m_windowSelector = new WindowSelectorFilter;
installInputEventFilter(m_windowSelector);
} }
installInputEventFilter(new DragAndDropInputFilter);
installInputEventFilter(new LockScreenFilter);
m_windowSelector = new WindowSelectorFilter;
installInputEventFilter(m_windowSelector);
if (hasGlobalShortcutSupport) { if (hasGlobalShortcutSupport) {
installInputEventFilter(new ScreenEdgeInputFilter); installInputEventFilter(new ScreenEdgeInputFilter);
} }
@ -2446,16 +2445,12 @@ void InputRedirection::setupInputFilters()
if (hasGlobalShortcutSupport) { if (hasGlobalShortcutSupport) {
installInputEventFilter(new GlobalShortcutFilter); installInputEventFilter(new GlobalShortcutFilter);
} }
if (waylandServer()) { installInputEventFilter(new PopupInputFilter);
installInputEventFilter(new PopupInputFilter);
}
installInputEventFilter(new DecorationEventFilter); installInputEventFilter(new DecorationEventFilter);
if (waylandServer()) { installInputEventFilter(new WindowActionInputFilter);
installInputEventFilter(new WindowActionInputFilter); installInputEventFilter(new InternalWindowEventFilter);
installInputEventFilter(new InternalWindowEventFilter); installInputEventFilter(new ForwardInputFilter);
installInputEventFilter(new ForwardInputFilter); installInputEventFilter(new TabletInputFilter);
installInputEventFilter(new TabletInputFilter);
}
} }
void InputRedirection::handleInputConfigChanged(const KConfigGroup &group) void InputRedirection::handleInputConfigChanged(const KConfigGroup &group)