[PATCH] qv4l2: Fix GL Capture not redrawing after close

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Closing the GL capture window and then reopening it would cause it
to become blank and not render any frames.

This is fixed by ignoring the close event and hiding the widget
manually in the event handler.

Signed-off-by: Tasos Sahanidis <tasos@xxxxxxxxxxxx>
---
 utils/qv4l2/capture-win-gl.cpp | 7 +++++++
 utils/qv4l2/capture-win-gl.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/utils/qv4l2/capture-win-gl.cpp b/utils/qv4l2/capture-win-gl.cpp
index fc8e7f45..05659259 100644
--- a/utils/qv4l2/capture-win-gl.cpp
+++ b/utils/qv4l2/capture-win-gl.cpp
@@ -44,6 +44,13 @@ void CaptureWinGL::stop()
 #endif
 }
 
+void CaptureWinGL::closeEvent(QCloseEvent *event)
+{
+	this->hide();
+	event->ignore();
+	emit close();
+}
+
 void CaptureWinGL::resizeEvent(QResizeEvent *event)
 {
 #ifdef HAVE_QTGL
diff --git a/utils/qv4l2/capture-win-gl.h b/utils/qv4l2/capture-win-gl.h
index 63b7c65f..35235d7a 100644
--- a/utils/qv4l2/capture-win-gl.h
+++ b/utils/qv4l2/capture-win-gl.h
@@ -139,6 +139,7 @@ public:
 protected:
 	void resizeEvent(QResizeEvent *event);
 	void setRenderFrame();
+	void closeEvent(QCloseEvent *event);
 
 private:
 #ifdef HAVE_QTGL
-- 
2.20.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux