From 2850d0c6bc115577d4114d257fceeffe9d1bb297 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Tue, 15 Oct 2019 14:59:37 +0200 Subject: [PATCH] avoid update of window title only update title if user really wants to display the FPS during gameplay. --- rpcs3/rpcs3qt/gs_frame.cpp | 7 ++++++- rpcs3/rpcs3qt/gs_frame.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 2651417220..56c6ecbe6f 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -280,13 +280,18 @@ void gs_frame::flip(draw_context_t, bool /*skip_frame*/) { static Timer fps_t; + if (!m_show_fps_in_title && !g_cfg.misc.show_fps_in_title) + { + return; + } + ++m_frames; if (fps_t.GetElapsedTimeInSec() >= 0.5) { QString fps_title; - if (g_cfg.misc.show_fps_in_title) + if ((m_show_fps_in_title = g_cfg.misc.show_fps_in_title.get())) { fps_title = qstr(fmt::format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec())); diff --git a/rpcs3/rpcs3qt/gs_frame.h b/rpcs3/rpcs3qt/gs_frame.h index d4df38f85c..e7aa344c93 100644 --- a/rpcs3/rpcs3qt/gs_frame.h +++ b/rpcs3/rpcs3qt/gs_frame.h @@ -36,6 +36,8 @@ private: std::shared_ptr m_gui_settings; u64 m_frames = 0; + // display status of last title update + bool m_show_fps_in_title = false; QString m_windowTitle; bool m_disable_mouse;