]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
ui/gtk: expose gd_monitor_update_interval
authorNikola Pavlica <pavlica.nikola@gmail.com>
Thu, 14 Jan 2021 14:01:52 +0000 (15:01 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 15 Jan 2021 10:22:42 +0000 (11:22 +0100)
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>
include/ui/gtk.h
ui/gtk.c

index 80851fb4c7e12d9421b395c67975f5c271584f4c..3f395d7f943b1040ec080eb905cfb57330f1fb36 100644 (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);
index d2004a4dc162194d306a81d2d23c897418cd7f9f..26665cd2e657faff3f5cfcf86577ec4f980bde5f 100644 (file)
--- 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);