From d8ea12e5670cec0dede42d053d097669466f9593 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Wed, 8 Jan 2020 16:21:50 +0100 Subject: [PATCH] ~ trying to update refresh rate --- src/GUI.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index c19d254..4688d11 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -39,6 +39,9 @@ int GUI_run(int argc, char **argv) { vkvm::registerEvent(vkvm::EventType::UpdateControlRegisters, [image, window, status]() { int newRedrawInterval = vkvm::getRedrawInterval(); if(newRedrawInterval != redrawInterval) { + /*if(redrawInterval == -1 && newRedrawInterval != -1) { + refreshCallback(image); + }*/ redrawInterval = newRedrawInterval; } @@ -66,7 +69,10 @@ static void refreshCallback(void * pointer) { auto *image = static_cast(pointer); image->getPixels(); - Fl::repeat_timeout((double) redrawInterval / 1000, redrawCallback, image); + if(redrawInterval != -1) { + Fl::repeat_timeout((double) redrawInterval / 1000, redrawCallback, image); + } + } static void redrawCallback(void * pointer) {