[vlc-commits] [Git][videolan/vlc][master] qt: x11: fix video freezes after window becomes minimized
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue Mar 25 05:56:59 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
0c2d3d4e by Fatih Uzunoglu at 2025-03-25T05:25:12+00:00
qt: x11: fix video freezes after window becomes minimized
I have KWin X11 and the window does not receive expose event
when the window is exposed. This seems to be the reason why
the video freezes after the window gets minimized.
- - - - -
2 changed files:
- modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.hpp
Changes:
=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
=====================================
@@ -352,6 +352,27 @@ CompositorX11RenderWindow::CompositorX11RenderWindow(qt_intf_t* p_intf, xcb_conn
setVisible(true);
m_wid = winId();
+
+ m_lastVisibility = visibility();
+
+ connect(this, &QWindow::visibilityChanged, this, [this](QWindow::Visibility visibility) {
+ if (visibility == QWindow::Visibility::Minimized)
+ {
+ // Hidden is handled in `QWindow::hideEvent()`.
+ emit visiblityChanged(false);
+ }
+ else if (m_lastVisibility == QWindow::Visibility::Minimized && visibility != QWindow::Visibility::Hidden)
+ {
+ // Show is handled in `QWindow::showEvent()`.
+ // Expose is handled in `QWindow::exposeEvent()`. However, KWin X11 does not send expose event when
+ // a window is restored from minimized state.
+ resetClientPixmaps();
+ emit visiblityChanged(true);
+ emit requestUIRefresh();
+ }
+
+ m_lastVisibility = visibility;
+ });
}
CompositorX11RenderWindow::~CompositorX11RenderWindow()
=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.hpp
=====================================
@@ -222,6 +222,8 @@ private:
CompositorX11UISurface* m_interfaceWindow = nullptr;
std::unique_ptr<CompositorX11RenderClient> m_interfaceClient;
+
+ QWindow::Visibility m_lastVisibility;
};
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0c2d3d4e9160c6102c93686e4ffbf21687a96be7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0c2d3d4e9160c6102c93686e4ffbf21687a96be7
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list