From: Nikola Pavlica <pavlica.nikola@gmail.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] display/gtk: get proper refreshrate
Date: Mon, 30 Dec 2019 18:28:02 +0100 [thread overview]
Message-ID: <8531e41f28df7f4bebe4db257ff95e92f5145afc.camel@gmail.com> (raw)
From 70c95b18fa056b2dd0ecc202ab517bc775b986da Mon Sep 17 00:00:00 2001
From: Nikola Pavlica <pavlica.nikola@gmail.com>
Date: Mon, 30 Dec 2019 18:17:35 +0100
Subject: [PATCH] display/gtk: get proper refreshrate
Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com>
---
ui/gtk.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/ui/gtk.c b/ui/gtk.c
index 692ccc7bbb..7a041457f2 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2259,6 +2259,11 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
opts->u.gtk.grab_on_hover) {
gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
}
+
+ GdkDisplay *display = gdk_display_get_default();
+ GdkMonitor *monitor = gdk_display_get_primary_monitor(display);
+ vc->gfx.dcl.update_interval = 1000000 /
+ gdk_monitor_get_refresh_rate(monitor);
}
static void early_gtk_display_init(DisplayOptions *opts)
--
2.24.0
next reply other threads:[~2019-12-30 22:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-30 17:28 Nikola Pavlica [this message]
2019-12-30 22:59 ` [PATCH] display/gtk: get proper refreshrate Philippe Mathieu-Daudé
[not found] ` <2ee36cb0103b60a4a0655a4c127469e6f49f8d46.camel@gmail.com>
2019-12-31 13:48 ` Philippe Mathieu-Daudé
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=8531e41f28df7f4bebe4db257ff95e92f5145afc.camel@gmail.com \
--to=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).