From 7420944b9d764ac675145fd2ef477b5ce3fd65ae Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Thu, 4 Jan 2024 20:17:51 +0800 Subject: [PATCH] fix: middle button does not work --- src/ui/articlewebview.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/articlewebview.cc b/src/ui/articlewebview.cc index f2cc18f9..76d21371 100644 --- a/src/ui/articlewebview.cc +++ b/src/ui/articlewebview.cc @@ -80,8 +80,14 @@ bool ArticleWebView::eventFilter( QObject * obj, QEvent * ev ) singleClickAction( pe ); } ); } - if ( pe->buttons() & Qt::MiddleButton ) + if ( pe->buttons() & Qt::MiddleButton ) { midButtonPressed = true; + QTimer::singleShot( 100, this, [ = ]() { + sendCustomMouseEvent( QEvent::MouseButtonPress ); + sendCustomMouseEvent( QEvent::MouseButtonRelease ); + } ); + return false; + } } if ( ev->type() == QEvent::MouseButtonRelease ) { auto pe = dynamic_cast< QMouseEvent * >( ev );