From 3d116d67cf448ec52520ff24121bd5a5dfce55b3 Mon Sep 17 00:00:00 2001 From: DuanRay Date: Tue, 17 Oct 2023 16:13:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E8=B0=83=E6=95=B4=E7=AA=97=E5=8F=A3=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=8F=B3=E4=BE=A7=E7=94=BB=E9=9D=A2=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF=E9=97=AA=E7=83=81=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...fix-draging-flickering-when-resizing.patch | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 0008-fix-draging-flickering-when-resizing.patch diff --git a/0008-fix-draging-flickering-when-resizing.patch b/0008-fix-draging-flickering-when-resizing.patch new file mode 100644 index 0000000..092bfb4 --- /dev/null +++ b/0008-fix-draging-flickering-when-resizing.patch @@ -0,0 +1,124 @@ +diff --git a/nfs-mplayer-1.0.0/src/baseguiplus.cpp b/nfs-mplayer-1.0.0/src/baseguiplus.cpp +index adf0b66..6ff4931 100755 +--- a/nfs-mplayer-1.0.0/src/baseguiplus.cpp ++++ b/nfs-mplayer-1.0.0/src/baseguiplus.cpp +@@ -845,6 +845,7 @@ void BaseGuiPlus::mousePressEvent(QMouseEvent *event) + { + if (!pref->fullscreen && Qt::WindowMaximized != windowState()) { + m_resizeFlag = true; ++ mplayerwindow->setDraging(true); + } + } + } +@@ -874,6 +875,7 @@ void BaseGuiPlus::mouseReleaseEvent(QMouseEvent *event) + } + m_iCalCursorPos = 0; + m_resizeFlag = false; ++ mplayerwindow->setDraging(false); + + // 鼠标释放时恢复光标样式 + this->setCursor(Qt::ArrowCursor); +diff --git a/nfs-mplayer-1.0.0/src/mplayerwindow.cpp b/nfs-mplayer-1.0.0/src/mplayerwindow.cpp +index 3c6e730..bf7682c 100755 +--- a/nfs-mplayer-1.0.0/src/mplayerwindow.cpp ++++ b/nfs-mplayer-1.0.0/src/mplayerwindow.cpp +@@ -197,9 +197,10 @@ MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f) + , drag_state(NOT_DRAGGING) + , start_drag(QPoint(0,0)) + , mouse_drag_tracking(false) ++ , isDraging(false) + { + mplayerlayer = new MplayerLayer(this); +- mplayerlayer->setMouseTracking(true); ++ mplayerlayer->setMouseTracking(true); + mplayerlayer->setObjectName("mplayerlayer"); + logo = new QLabel( mplayerlayer ); + logo->setObjectName("mplayerwindowlogo"); +@@ -243,11 +244,22 @@ MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f) + connect(left_click_timer, SIGNAL(timeout()), this, SIGNAL(leftClicked())); + + retranslateStrings(); ++ ++ refreshMplayerLayoutFlag = true; ++ ++ m_resizeTimer = new QTimer(this); ++ connect( m_resizeTimer, SIGNAL(timeout()), this, SLOT(refreshMplayerLayout())); ++ m_resizeTimer->start(90); //redraw frame every 90ms when resizing. + } + + MplayerWindow::~MplayerWindow() { + } + ++void MplayerWindow::refreshMplayerLayout() ++{ ++ refreshMplayerLayoutFlag = true; ++} ++ + void MplayerWindow::setCornerWidget(QWidget * w) { + corner_widget = w; + +@@ -316,6 +328,13 @@ void MplayerWindow::resizeEvent( QResizeEvent * /* e */) + { + /*qDebug("MplayerWindow::resizeEvent: %d, %d", + e->size().width(), e->size().height() );*/ ++ ++ if(isDraging && !refreshMplayerLayoutFlag) ++ { ++ return; ++ } ++ ++ refreshMplayerLayoutFlag = false; + + #if !DELAYED_RESIZE + offset_x = 0; +@@ -390,8 +409,8 @@ void MplayerWindow::updateVideoWindow() + } + } + +- mplayerlayer->move(x,y); +- mplayerlayer->resize(w, h); ++ mplayerlayer->move(x, y); ++ mplayerlayer->resize(w, h); + + orig_x = x; + orig_y = y; +@@ -600,6 +619,11 @@ void MplayerWindow::setZoom( double d) { + + double MplayerWindow::zoom() { return zoom_factor; } + ++void MplayerWindow::setDraging(bool draging) ++{ ++ isDraging = draging; ++} ++ + void MplayerWindow::moveLayer( int offset_x, int offset_y ) { + int x = mplayerlayer->x(); + int y = mplayerlayer->y(); +diff --git a/nfs-mplayer-1.0.0/src/mplayerwindow.h b/nfs-mplayer-1.0.0/src/mplayerwindow.h +index a137533..451eb2e 100755 +--- a/nfs-mplayer-1.0.0/src/mplayerwindow.h ++++ b/nfs-mplayer-1.0.0/src/mplayerwindow.h +@@ -154,7 +154,8 @@ public: + + void delayLeftClick(bool b) { delay_left_click = b; }; + bool isLeftClickDelayed() { return delay_left_click; }; +- ++ void setDraging(bool draging); ++ + virtual QSize sizeHint () const; + virtual QSize minimumSizeHint() const; + +@@ -253,6 +254,13 @@ private: + TDragState drag_state; + QPoint start_drag; + bool mouse_drag_tracking; ++ ++ QTimer *m_resizeTimer; ++ bool refreshMplayerLayoutFlag; ++ bool isDraging; ++ ++private slots: ++ void refreshMplayerLayout(); + }; + + #endif -- Gitee From 8eb3e787239f8547deb879d91f0101cdd60d3e40 Mon Sep 17 00:00:00 2001 From: DuanRay Date: Wed, 18 Oct 2023 10:53:54 +0800 Subject: [PATCH 2/2] chore: update .spec file --- nfs-mplayer.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nfs-mplayer.spec b/nfs-mplayer.spec index b2538c8..4e16240 100644 --- a/nfs-mplayer.spec +++ b/nfs-mplayer.spec @@ -1,10 +1,18 @@ Name: nfs-mplayer Version: 1.0.0 -Release: 1 +Release: 9%{?dist} Summary: A great media player Group: Applications/Multimedia License: GPLv2+ Source0: %{name}-%{version}.tar.gz +Patch0: 0001-fix-show-desktop-background-before-start-play.patch +Patch1: 0002-resize-mini-mode-exeption.patch +Patch2: 0003-sometimes-cannot-loop-playback.patch +Patch3: 0004-transparent-bottom-control-bar-after-maximizing-the-window.patch +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 %if 0%{?suse_version} BuildRequires: hicolor-icon-theme @@ -104,3 +112,10 @@ update-desktop-database &> /dev/null || : /usr/bin/nfsmplayer_web_server %changelog + +* Wed Oct 18 2023 ruizhe - 1.0.0-9 +- Fix draging flickering when resizing + +* Wed Oct 18 2023 ruizhe - 1.0.0-8 +- Fix main menu display error in max mode. + -- Gitee