From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@web.de>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Nikola Pavlica" <pavlica.nikola@gmail.com>
Subject: [PATCH v2 1/2] ui/gtk: Update gd_refresh_rate_millihz() to handle VirtualConsole
Date: Sat, 8 Feb 2020 17:10:47 +0100 [thread overview]
Message-ID: <20200208161048.11311-2-f4bug@amsat.org> (raw)
In-Reply-To: <20200208161048.11311-1-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
ui/gtk.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index d18892d1de..c59297ff4d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1965,11 +1965,11 @@ static GtkWidget *gd_create_menu_machine(GtkDisplayState *s)
* If available, return the refresh rate of the display in milli-Hertz,
* else return 0.
*/
-static int gd_refresh_rate_millihz(GtkDisplayState *s)
+static int gd_refresh_rate_millihz(GtkWidget *window)
{
#ifdef GDK_VERSION_3_22
- GdkDisplay *dpy = gtk_widget_get_display(s->window);
- GdkWindow *win = gtk_widget_get_window(s->window);
+ GdkDisplay *dpy = gtk_widget_get_display(window);
+ GdkWindow *win = gtk_widget_get_window(window);
GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win);
return gdk_monitor_get_refresh_rate(monitor);
@@ -2045,7 +2045,8 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
vc->gfx.kbd = qkbd_state_init(con);
vc->gfx.dcl.con = con;
- refresh_rate_millihz = gd_refresh_rate_millihz(s);
+ refresh_rate_millihz = gd_refresh_rate_millihz(vc->window ?
+ vc->window : s->window);
if (refresh_rate_millihz) {
vc->gfx.dcl.update_interval = MILLISEC_PER_SEC / refresh_rate_millihz;
}
--
2.21.1
next prev parent reply other threads:[~2020-02-08 16:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-08 16:10 [PATCH v2 0/2] ui/gtk: Fix gd_refresh_rate_millihz() when widget window is not realized Philippe Mathieu-Daudé
2020-02-08 16:10 ` Philippe Mathieu-Daudé [this message]
2020-02-08 16:10 ` [PATCH v2 2/2] " Philippe Mathieu-Daudé
2020-02-08 17:27 ` [PATCH v2 0/2] " Jan Kiszka
2020-02-12 12:23 ` Gerd Hoffmann
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=20200208161048.11311-2-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=jan.kiszka@web.de \
--cc=kraxel@redhat.com \
--cc=pavlica.nikola@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).