From e80be993b53f27000bb2f224e9540a7c7cf04fae Mon Sep 17 00:00:00 2001 From: Volker RĂ¼melin Date: Sun, 13 Dec 2020 17:57:22 +0100 Subject: ui/gtk: don't try to redefine SI prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Redefining SI prefixes is always wrong. 1s has per definition 1000ms. Remove the misnamed named constant and replace it with a comment explaining the frequency to period conversion in two simple steps. Now you can cancel out the unit mHz in the comment with the implicit unit mHz in refresh_rate_millihz and see why the implicit unit ms for update_interval remains. Signed-off-by: Volker RĂ¼melin Message-Id: <20201213165724.13418-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- include/ui/gtk.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/ui/gtk.h') diff --git a/include/ui/gtk.h b/include/ui/gtk.h index eaeb450f91..80851fb4c7 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -24,8 +24,6 @@ #include "ui/egl-context.h" #endif -#define MILLISEC_PER_SEC 1000000 - typedef struct GtkDisplayState GtkDisplayState; typedef struct VirtualGfxConsole { -- cgit 1.4.1 From 0fdc99775c03cd31d5e99c8608113ac00ff6266b Mon Sep 17 00:00:00 2001 From: Nikola Pavlica Date: Thu, 14 Jan 2021 15:01:52 +0100 Subject: ui/gtk: expose gd_monitor_update_interval The gd_egl_refresh function, as the name suggests, is responsible for refreshing displays when using EGL graphics with QEMU's GTK UI. This is a perfect candidate for a function to update the refresh rate in. Since gd_monitor_update_interval is inaccessible from the gd_egl_refresh function, we need to expose/globalize it in the include/ui/gtk.h file. Signed-off-by: Nikola Pavlica Message-Id: <20210114140153.301473-2-pavlica.nikola@gmail.com> Signed-off-by: Gerd Hoffmann --- include/ui/gtk.h | 1 + ui/gtk.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include/ui/gtk.h') diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 80851fb4c7..3f395d7f94 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -86,6 +86,7 @@ extern bool gtk_use_gl_area; /* ui/gtk.c */ void gd_update_windowsize(VirtualConsole *vc); +int gd_monitor_update_interval(GtkWidget *widget); /* ui/gtk-egl.c */ void gd_egl_init(VirtualConsole *vc); diff --git a/ui/gtk.c b/ui/gtk.c index d2004a4dc1..26665cd2e6 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -752,7 +752,7 @@ static void gd_resize_event(GtkGLArea *area, * If available, return the update interval of the monitor in ms, * else return 0 (the default update interval). */ -static int gd_monitor_update_interval(GtkWidget *widget) +int gd_monitor_update_interval(GtkWidget *widget) { #ifdef GDK_VERSION_3_22 GdkWindow *win = gtk_widget_get_window(widget); -- cgit 1.4.1