From 2fd85facf85b39f84eeada10bcf80060bb72ab51 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Thu, 24 Aug 2017 18:33:27 +0200 Subject: Fix DolphinRemoveAction Shift toggling on Wayland QGuiApplication::queryKeyboardModifiers() does not work on Wayland [1]. We don't need it in the first place, since we already know (thanks to the key events) whether Shift has been pressed or released. So we can just pass this information to DolphinRemoveAction::update(). BUG: 354301 [1]: https://bugreports.qt.io/browse/QTBUG-62786 Differential Revision: https://phabricator.kde.org/D7519 --- src/dolphinpart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dolphinpart.cpp') diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index c38625096..b3b47304e 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -597,6 +597,7 @@ void DolphinPart::setFilesToSelect(const QList& files) bool DolphinPart::eventFilter(QObject* obj, QEvent* event) { + using ShiftState = DolphinRemoveAction::ShiftState; const int type = event->type(); if ((type == QEvent::KeyPress || type == QEvent::KeyRelease) && m_removeAction) { @@ -604,7 +605,7 @@ bool DolphinPart::eventFilter(QObject* obj, QEvent* event) if (menu && menu->parent() == m_view) { QKeyEvent* ev = static_cast(event); if (ev->key() == Qt::Key_Shift) { - m_removeAction->update(); + m_removeAction->update(type == QEvent::KeyPress ? ShiftState::Pressed : ShiftState::Released); } } } -- cgit v1.3