From: Nikola Pavlica <pavlica.nikola@gmail.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com, f4bug@amsat.org
Subject: [PATCH 1/1] ui/gtk: Launching GTK UI with OpenGL on causes the refreshrate update to not run
Date: Sun, 06 Dec 2020 11:43:52 +0100 [thread overview]
Message-ID: <55ZWKQ.X7E8ESP709H31@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
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?
Anyway, regardless of method, I'm happy with any solution that just
fixes the issue.
Signed-off-by: Nikola Pavlica (pavlica.nikola@gmail.com)
---
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
[-- Attachment #2: Type: text/html, Size: 3369 bytes --]
next reply other threads:[~2020-12-06 10:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 10:43 Nikola Pavlica [this message]
2020-12-06 11:42 ` [PATCH 1/1] ui/gtk: Launching GTK UI with OpenGL on causes the refreshrate update to not run Philippe Mathieu-Daudé
2020-12-06 11:44 ` Philippe Mathieu-Daudé
2023-05-15 16:17 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55ZWKQ.X7E8ESP709H31@gmail.com \
--to=pavlica.nikola@gmail.com \
--cc=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.