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 <pavlica.nikola@gmail.com>
Message-Id: <20210114140153.301473-2-pavlica.nikola@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Nikola Pavlica 2021-01-14 15:01:52 +01:00 committed by Gerd Hoffmann
parent 3c4b8f8310
commit 0fdc99775c
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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);