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 0000000000000000000000000000000000000000..6317e3ec08687880a67474afccbe5c316548da61 --- /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 4e16240ca309eb3455d9c32d22dec21e9a2d47e6..98fc3f10b45bdaaf64daf4f3a095d75d68ef9eb1 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