linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qv4l2: Fix GL Capture not redrawing after close
@ 2019-05-09 12:47 Tasos Sahanidis
  0 siblings, 0 replies; only message in thread
From: Tasos Sahanidis @ 2019-05-09 12:47 UTC (permalink / raw)
  To: linux-media

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@tasossah.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-09 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 12:47 [PATCH] qv4l2: Fix GL Capture not redrawing after close Tasos Sahanidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).