From 5fea367fc98dd427497a93a9d1e73b2c2d4a2271 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 4 Sep 2021 13:24:37 +0800 Subject: [PATCH] C3: Fix keyboard buttons on the right getting stuck in pressed state (#22050) * fix keyboard state stuck * remove popup flag * update in time --- selfdrive/ui/qt/widgets/input.cc | 1 - selfdrive/ui/qt/widgets/keyboard.cc | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/widgets/input.cc b/selfdrive/ui/qt/widgets/input.cc index 8e978ca33d..f23d9b8b80 100644 --- a/selfdrive/ui/qt/widgets/input.cc +++ b/selfdrive/ui/qt/widgets/input.cc @@ -12,7 +12,6 @@ QDialogBase::QDialogBase(QWidget *parent) : QDialog(parent) { Q_ASSERT(parent != nullptr); parent->installEventFilter(this); - setWindowFlags(Qt::Popup); setStyleSheet(R"( * { outline: none; diff --git a/selfdrive/ui/qt/widgets/keyboard.cc b/selfdrive/ui/qt/widgets/keyboard.cc index 349e53054c..11b22d35c0 100644 --- a/selfdrive/ui/qt/widgets/keyboard.cc +++ b/selfdrive/ui/qt/widgets/keyboard.cc @@ -31,6 +31,9 @@ bool KeyButton::event(QEvent *event) { QMouseEvent mouseEvent(mouseType, touchEvent->touchPoints().front().pos(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QPushButton::event(&mouseEvent); event->accept(); + if (mouseType == QEvent::MouseButtonRelease) { + parentWidget()->update(); + } return true; } }