RĂ©mi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
1bb350fc by Prince Gupta at 2024-02-20T08:31:19+00:00
qt, windows: fix flickering of acrylic
don't reset acrylic surface on window position change
fixes #27603
- - - - -
59694013 by Prince Gupta at 2024-02-20T08:31:19+00:00
qt, dcomp: remove requestReset from acrylic surface
code is not used anymore
- - - - -
2 changed files:
- modules/gui/qt/maininterface/compositor_dcomp_acrylicsurface.cpp
- modules/gui/qt/maininterface/compositor_dcomp_acrylicsurface.hpp
Changes:
=====================================
modules/gui/qt/maininterface/compositor_dcomp_acrylicsurface.cpp
=====================================
@@ -106,6 +106,16 @@
CompositorDCompositionAcrylicSurface::CompositorDCompositionAcrylicSurface(qt_in
{
setActive(m_transparencyEnabled && m_mainCtx->acrylicActive());
});
+
+ // CSDWin32EventHandler updates frame when window is maximized
+ connect(window(), &QWindow::windowStateChanged, this, [this]()
+ {
+ sync();
+ commitChanges();
+ }
+ // CSDWin32EventHandler changes client rect on window state change
+ // use queued connection so that we can get correct state.
+ , Qt::QueuedConnection);
}
CompositorDCompositionAcrylicSurface::~CompositorDCompositionAcrylicSurface()
@@ -132,8 +142,6 @@ bool
CompositorDCompositionAcrylicSurface::nativeEventFilter(const QByteArray &,
sync();
commitChanges();
-
- requestReset(); // in case z-order changed
break;
}
case WM_SETTINGCHANGE:
@@ -417,15 +425,6 @@ void CompositorDCompositionAcrylicSurface::commitChanges()
DwmFlush();
}
-void CompositorDCompositionAcrylicSurface::requestReset()
-{
- if (m_resetPending)
- return;
-
- m_resetPending = true;
- m_resetTimer.start(5, Qt::PreciseTimer, this);
-}
-
void CompositorDCompositionAcrylicSurface::setActive(const bool newActive)
{
if (newActive == m_active)
@@ -459,20 +458,4 @@ HWND CompositorDCompositionAcrylicSurface::hwnd()
return nullptr;
}
-void CompositorDCompositionAcrylicSurface::timerEvent(QTimerEvent *event)
-{
- if (!event)
- return;
-
- if (event->timerId() == m_resetTimer.timerId())
- {
- m_resetPending = false;
- m_resetTimer.stop();
-
- updateVisual();
- sync();
- commitChanges();
- }
-}
-
}
=====================================
modules/gui/qt/maininterface/compositor_dcomp_acrylicsurface.hpp
=====================================
@@ -177,8 +177,6 @@ public:
protected:
bool nativeEventFilter(const QByteArray &eventType, void *message, long
*result) override;
- void timerEvent(QTimerEvent *event) override;
-
private:
bool init(ID3D11Device *device);
bool loadFunctions();
@@ -191,7 +189,6 @@ private:
void sync();
void updateVisual();
void commitChanges();
- void requestReset();
void setActive(bool newActive);
@@ -228,7 +225,6 @@ private:
qt_intf_t *m_intf = nullptr;
CompositorDirectComposition *m_compositor = nullptr;
MainCtx *m_mainCtx = nullptr;
- QBasicTimer m_resetTimer;
bool m_resetPending = false;
bool m_active = false;
bool m_transparencyEnabled = false;
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/509c0e816d99d05d9efc72e6d4302aa2100ad7f7...5969401387ad119c0421fb582caf162d2acc51bb
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/509c0e816d99d05d9efc72e6d4302aa2100ad7f7...5969401387ad119c0421fb582caf162d2acc51bb
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits