Hi Nikola, On 12/6/20 11:43 AM, Nikola Pavlica wrote: > I've discussed this issue back January and September. But it still > occurs on my machine, despite the two patches. This time, the issue is > that the UI refresh rate doesn't get updated when I launch QEMU with > gl=on. My fix for this issue is to move the code for updating the > refresh rate above the code that checks for OpenGL. > > Or because OpenGL is meant to be called back with the "render" callback, > should we instead add the refresh > rate checking code there?
This is not my area, but I think you are right, the the refresh rate should be updated in the "render" callback. To speed things you can send another patch, and Gerd will pick the correct/best one :) > Anyway, regardless of method, I'm happy with any solution that just > fixes the issue. > Signed-off-by: Nikola Pavlica ([email protected])--- > diff --git a/ui/gtk.c b/ui/gtk.c > index a752aa22be..74287edde8 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -776,18 +776,6 @@ static gboolean gd_draw_event(GtkWidget *widget, > cairo_t *cr, void *opaque) > Â Â Â int fbw, fbh; > Â Â Â int refresh_rate_millihz; > Â > -#if defined(CONFIG_OPENGL) > - Â Â if (vc->gfx.gls) { > - Â Â Â Â if (gtk_use_gl_area) { > - Â Â Â Â Â Â /* invoke render callback please */ > - Â Â Â Â Â Â return FALSE; > - Â Â Â Â } else { > - Â Â Â Â Â Â gd_egl_draw(vc); > - Â Â Â Â Â Â return TRUE; > - Â Â Â Â } > - Â Â } > -#endif > - > Â Â Â if (!gtk_widget_get_realized(widget)) { > Â Â Â Â Â return FALSE; > Â Â Â } > @@ -801,6 +789,18 @@ static gboolean gd_draw_event(GtkWidget *widget, > cairo_t *cr, void *opaque) > Â Â Â Â Â vc->gfx.dcl.update_interval = MILLISEC_PER_SEC / > refresh_rate_millihz; > Â Â Â } > Â > +#if defined(CONFIG_OPENGL) > + Â Â if (vc->gfx.gls) { > + Â Â Â Â if (gtk_use_gl_area) { > + Â Â Â Â Â Â /* invoke render callback please */ > + Â Â Â Â Â Â return FALSE; > + Â Â Â Â } else { > + Â Â Â Â Â Â gd_egl_draw(vc); > + Â Â Â Â Â Â return TRUE; > + Â Â Â Â } > + Â Â } > +#endif > + > Â Â Â fbw = surface_width(vc->gfx.ds); > Â Â Â fbh = surface_height(vc->gfx.ds); > -- > 2.21.1
