ui/gtk: Launching GTK UI with OpenGL on causes the refreshrate update to not run
PATCH v2 1/1 ui/gtk: Launching GTK UI with OpenGL on causes the refreshrate update to not run
As suggested before, I've instead copied the code to the appropriate callback function so that the refresh rate gets properly updated.
Also to avoid repeating the gd_refresh_rate_millihz function, I've globalized it. I hope you don't mind.
---
include/ui/gtk.h +0 -0
@@ -88,6 +88,7 @@ extern bool gtk_use_gl_area;
/* ui/gtk.c */
void gd_update_windowsize(VirtualConsole *vc);
+int gd_refresh_rate_millihz(GtkWidget *window);
/* ui/gtk-egl.c */
void gd_egl_init(VirtualConsole *vc);
ui/gtk-egl.c +0 -0
@@ -112,6 +112,14 @@ void gd_egl_update(DisplayChangeListener *dcl,
void gd_egl_refresh(DisplayChangeListener *dcl)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);+ int refresh_rate_millihz;
+
+ refresh_rate_millihz = gd_refresh_rate_millihz(vc->window ? vc->window :
+ vc->gfx.drawing_area);
+ if (refresh_rate_millihz) {
+ vc->gfx.dcl.update_interval = MILLISEC_PER_SEC / refresh_rate_millihz;
+ }
+
if (!vc->gfx.esurface) {
gd_egl_init(vc);ui/gtk.c +1 -1
@@ -752,7 +752,7 @@ static void gd_resize_event(GtkGLArea *area,* If available, return the refresh rate of the display in milli-Hertz, * else return 0. */ -static int gd_refresh_rate_millihz (GtkWidget *window) +int gd_refresh_rate_millihz (GtkWidget *window)
{
#ifdef GDK_VERSION_3_22
GdkWindow *win = gtk_widget_get_window(window);Signature · 1 line
2.21.1
Re: [PATCH v2 1/1] ui/gtk: Launching GTK UI with OpenGL on causes the? refreshrate update to not run
Hi,
Quoted 3 lines
/*
ui/gtk.c*/
voidgd_update_windowsize(VirtualConsole *vc);
+intgd_refresh_rate_millihz(GtkWidget *window);
Patch is whitespace-mangled.
Can you resend with "git send-email"?
thanks,
Gerd