ui/gtk: limit virtual console max update interval
commit3c4b8f8310ad9fae3c0b36f1e871e2f9b5973550
authorVolker Rümelin <vr_qemu@t-online.de>
Sun, 13 Dec 2020 16:57:24 +0000 (13 17:57 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 15 Jan 2021 10:22:42 +0000 (15 11:22 +0100)
tree7cc8ad3110f7678fa89a2a45bef6a90590ae2d5a
parent0431e369b0bafb17085c8635d8f719f4e01cc4b7
ui/gtk: limit virtual console max update interval

Limit the virtual console maximum update interval to
GUI_REFRESH_INTERVAL_DEFAULT. This papers over a integer
overflow bug in gtk3 on Windows where the reported monitor
refresh frequency can be much smaller than the real refresh
frequency.

The gtk bug report can be found here:
https://gitlab.gnome.org/GNOME/gtk/-/issues/3394

On my Windows 10 system gtk reports a monitor refresh rate of
1.511Hz instead of 60.031Hz and slows down the screen update
rate in qemu to a crawl. Provided you are affected by the gtk
bug on Windows, these are the steps to reproduce the issue:

Start qemu with -display gtk and activate all qemu virtual
consoles and notice the reduced qemu refresh rate. Activating
all virtual consoles is necessary, because gui_update() in
ui/console.c uses the minimum of all display change listeners
update interval and not yet activated virtual consoles report
the default update interval (30ms).

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20201213165724.13418-3-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c