From 32114134d6a5b409e2a0c3113d7a75dda32ca877 Mon Sep 17 00:00:00 2001 From: DuanRay Date: Wed, 18 Oct 2023 13:21:46 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E4=BF=AE=E5=A4=8D=E5=BD=93=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E7=AA=97=E5=8F=A3=E6=97=B6=EF=BC=8C=E8=83=BD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=8E=B7=E5=8F=96=E9=BC=A0=E6=A0=87=E6=9D=BE=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g-error-cannot-capture-mouse-release.patch | 104 ++++++++++++++++++ nfs-mplayer.spec | 6 +- 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 0009-fix-window-resizing-error-cannot-capture-mouse-release.patch diff --git a/0009-fix-window-resizing-error-cannot-capture-mouse-release.patch b/0009-fix-window-resizing-error-cannot-capture-mouse-release.patch new file mode 100644 index 0000000..6317e3e --- /dev/null +++ b/0009-fix-window-resizing-error-cannot-capture-mouse-release.patch @@ -0,0 +1,104 @@ +diff --git a/nfs-mplayer-1.0.0/src/basegui.h b/nfs-mplayer-1.0.0/src/basegui.h +index 7613660..b84496c 100755 +--- a/nfs-mplayer-1.0.0/src/basegui.h ++++ b/nfs-mplayer-1.0.0/src/basegui.h +@@ -347,6 +347,7 @@ protected slots: + virtual void xbutton2ClickFunction(); + virtual void processFunction(QString function); + ++ virtual void doMouseRelease() = 0; + virtual void dragEnterEvent( QDragEnterEvent * ) ; + virtual void dropEvent ( QDropEvent * ); + +diff --git a/nfs-mplayer-1.0.0/src/baseguiplus.cpp b/nfs-mplayer-1.0.0/src/baseguiplus.cpp +index 6ff4931..21dcfea 100755 +--- a/nfs-mplayer-1.0.0/src/baseguiplus.cpp ++++ b/nfs-mplayer-1.0.0/src/baseguiplus.cpp +@@ -235,6 +235,9 @@ BaseGuiPlus::BaseGuiPlus( QWidget * parent, Qt::WindowFlags flags) + retranslateStrings(); + loadConfig(); + m_iCalCursorPos = 0; ++ ++ installEventFilter(this); ++ connect( mplayerwindow, SIGNAL(mouseRelease()), this, SLOT(doMouseRelease())); + } + + BaseGuiPlus::~BaseGuiPlus() { +@@ -292,6 +295,14 @@ void BaseGuiPlus::populateMainMenu() { + #endif + } + ++void BaseGuiPlus::doMouseRelease() ++{ ++ if(m_resizeFlag) ++ m_resizeFlag = false; ++ ++ mplayerwindow->setDraging(false); ++} ++ + bool BaseGuiPlus::startHidden() { + #if defined(Q_OS_WIN) || defined(Q_OS_OS2) + return false; +@@ -855,11 +866,14 @@ void BaseGuiPlus::mousePressEvent(QMouseEvent *event) + + emit volMenuNeedHide(); + playlist->hide(); ++ ++ grabMouse(); //有时存在能捕获鼠标按下,但是无法捕获鼠标release的情况,加入grabMouse & releaseMouse函数能解决此问题。 + } + + void BaseGuiPlus::mouseReleaseEvent(QMouseEvent *event) + { + qDebug("BaseGuiPlus::mouseReleaseEvent"); ++ releaseMouse(); //释放按下状态 + if(event->y() < m_titleHight && event->y()> m_frameShape && m_moveFlag) + { + // 无需处理 +@@ -867,6 +881,7 @@ void BaseGuiPlus::mouseReleaseEvent(QMouseEvent *event) + else + { + m_resizeFlag = !m_resizeFlag; ++ mplayerwindow->setDraging(m_resizeFlag); + QApplication::restoreOverrideCursor(); + } + +diff --git a/nfs-mplayer-1.0.0/src/baseguiplus.h b/nfs-mplayer-1.0.0/src/baseguiplus.h +index 7278fda..b712898 100755 +--- a/nfs-mplayer-1.0.0/src/baseguiplus.h ++++ b/nfs-mplayer-1.0.0/src/baseguiplus.h +@@ -104,6 +104,8 @@ protected: + virtual void mainMenu(); + virtual void populateMainMenu(); + ++ virtual void doMouseRelease(); ++ + void loadConfig(); + void saveConfig(); + void updateShowAllAct(); +diff --git a/nfs-mplayer-1.0.0/src/mplayerwindow.cpp b/nfs-mplayer-1.0.0/src/mplayerwindow.cpp +index bf7682c..5e4cd4d 100755 +--- a/nfs-mplayer-1.0.0/src/mplayerwindow.cpp ++++ b/nfs-mplayer-1.0.0/src/mplayerwindow.cpp +@@ -424,7 +424,8 @@ void MplayerWindow::updateVideoWindow() + + void MplayerWindow::mouseReleaseEvent( QMouseEvent * e) { + qDebug( "MplayerWindow::mouseReleaseEvent" ); +- ++ ++ emit mouseRelease(); + if (e->button() == Qt::LeftButton) { + e->accept(); + if (delay_left_click) { +diff --git a/nfs-mplayer-1.0.0/src/mplayerwindow.h b/nfs-mplayer-1.0.0/src/mplayerwindow.h +index 451eb2e..fecd85e 100755 +--- a/nfs-mplayer-1.0.0/src/mplayerwindow.h ++++ b/nfs-mplayer-1.0.0/src/mplayerwindow.h +@@ -214,6 +214,8 @@ signals: + void wheelDown(); + void mouseMovedDiff(QPoint); + ++ void mouseRelease(); ++ + void mainLogoStatus(bool); + + protected: diff --git a/nfs-mplayer.spec b/nfs-mplayer.spec index 4e16240..98fc3f1 100644 --- a/nfs-mplayer.spec +++ b/nfs-mplayer.spec @@ -1,6 +1,6 @@ Name: nfs-mplayer Version: 1.0.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: A great media player Group: Applications/Multimedia License: GPLv2+ @@ -13,6 +13,7 @@ Patch4: 0005-set-stylesheet-to-affect-only-itself.patch Patch5: 0006-fix-file-operation-will-pause-video-play.patch Patch6: 0007-show-main-menu-in-max-mode.patch Patch7: 0008-fix-draging-flickering-when-resizing.patch +Patch8: 0009-fix-window-resizing-error-cannot-capture-mouse-release.patch %if 0%{?suse_version} BuildRequires: hicolor-icon-theme @@ -113,6 +114,9 @@ update-desktop-database &> /dev/null || : %changelog +* Wed Oct 18 2023 ruizhe - 1.0.0-10 +- Fix window resizing error cannot capture mouse release + * Wed Oct 18 2023 ruizhe - 1.0.0-9 - Fix draging flickering when resizing -- Gitee