diff mbox series

[3/6] kernel-shark: Enforce update of the OpenGL widget when loading new session

Message ID 20190515190911.20755-4-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Headers show
Series Various modifications and fixes toward KS 1.0 | expand

Commit Message

Yordan Karadzhov May 15, 2019, 7:09 p.m. UTC
This is needed in the case when the session was saved at different screen
resolution.

Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/KsGLWidget.hpp   | 3 +++
 kernel-shark/src/KsMainWindow.cpp | 3 +--
 kernel-shark/src/KsTraceGraph.cpp | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/kernel-shark/src/KsGLWidget.hpp b/kernel-shark/src/KsGLWidget.hpp
index 3bcecf9..bc5cacf 100644
--- a/kernel-shark/src/KsGLWidget.hpp
+++ b/kernel-shark/src/KsGLWidget.hpp
@@ -41,6 +41,9 @@  public:
 
 	void reset();
 
+	/** Reprocess all graphs. */
+	void update() {resizeGL(width(), height());}
+
 	void mousePressEvent(QMouseEvent *event);
 
 	void mouseMoveEvent(QMouseEvent *event);
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index bb593bd..3cf10bc 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -435,7 +435,6 @@  QString KsMainWindow::lastSessionFile()
 void KsMainWindow::_restoreSession()
 {
 	loadSession(lastSessionFile());
-	_graph.updateGeom();
 }
 
 void KsMainWindow::_importSession()
@@ -450,7 +449,6 @@  void KsMainWindow::_importSession()
 		return;
 
 	loadSession(fileName);
-	_graph.updateGeom();
 }
 
 void KsMainWindow::_updateSession()
@@ -1100,6 +1098,7 @@  void KsMainWindow::loadSession(const QString &fileName)
 
 	_session.loadTable(&_view);
 	_colorPhaseSlider.setValue(_session.getColorScheme() * 100);
+	_graph.updateGeom();
 }
 
 void KsMainWindow::_initCapture()
diff --git a/kernel-shark/src/KsTraceGraph.cpp b/kernel-shark/src/KsTraceGraph.cpp
index 6087e96..da2c6aa 100644
--- a/kernel-shark/src/KsTraceGraph.cpp
+++ b/kernel-shark/src/KsTraceGraph.cpp
@@ -538,6 +538,8 @@  void KsTraceGraph::updateGeom()
 			       * allow the scroll bar to disappear when the
 			       * widget is extended to maximum.
 			       */
+
+	_glWindow.update();
 }
 
 void KsTraceGraph::_updateGraphLegends()