diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-07-12 21:47:21 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-07-12 21:47:21 +0200 |
commit | 5e98019ff981053fedc5fb5807b32e3ce0373eec (patch) | |
tree | 08a4e16c208a9402ab3cc31d4251cd079f8f4f12 | |
parent | 6622c2a0b74dfe23d8be8d0203de20a48e24ae3f (diff) |
Attempt to fix slowdown regression
-rw-r--r-- | include/QuickMedia.hpp | 1 | ||||
-rw-r--r-- | src/QuickMedia.cpp | 11 |
2 files changed, 2 insertions, 10 deletions
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index ea814e4..0a21e07 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -243,7 +243,6 @@ namespace QuickMedia { std::mutex login_inputs_mutex; const char *yt_dl_name = nullptr; - mgl::Clock update_monitor_max_fps_timer; int monitor_max_fps = 0; }; } diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 051b08d..3a42906 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1465,16 +1465,9 @@ namespace QuickMedia { } void Program::idle_active_handler() { - if(idle) { - if(update_monitor_max_fps_timer.get_elapsed_time_seconds() >= 3.0) { - update_monitor_max_fps_timer.restart(); - monitor_max_fps = 0; - for_each_active_monitor_output(disp, [&](const XRRCrtcInfo*, const XRRModeInfo *mode_info) { - monitor_max_fps = std::max(monitor_max_fps, monitor_info_get_fps(mode_info)); - }); - } + if(idle) window.set_framerate_limit(monitor_max_fps); - } + idle = false; idle_timer.restart(); } |