From nobody Fri Mar 29 01:47:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1581524340012114.2200725881928; Wed, 12 Feb 2020 08:19:00 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-hXCjPzXsN6Gdoxxy3keMIQ-1; Wed, 12 Feb 2020 11:18:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E222518CA243; Wed, 12 Feb 2020 16:18:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2017B61069; Wed, 12 Feb 2020 16:18:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 28618866C1; Wed, 12 Feb 2020 16:18:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CGIhb5030123 for ; Wed, 12 Feb 2020 11:18:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7AD5F5C54A; Wed, 12 Feb 2020 16:18:43 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5E9E5C240; Wed, 12 Feb 2020 16:18:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D11669D1F; Wed, 12 Feb 2020 17:18:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581524338; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1KIHTt1+MMh3tS0Tz2tXta1bnVaXy/hfgKs9ZpWu9zg=; b=Zy8lN2NjCQlEtPECadsfVINKMyWEdLzmnQJFPGjgLTlUT7WpiERVBCGdMJXfxmpwt270WN JSRV8QCloNMP+k6Ru2j8pl0sP6dOcOmlaZE2WqsoCBXv9gAhRxXjP/VUCjXedZU9Lv/KcA rKQCri1wafCClM5SW6yhc5nJ3Tp6CXU= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/10] ui/gtk: Update gd_refresh_rate_millihz() to handle VirtualConsole Date: Wed, 12 Feb 2020 17:18:26 +0100 Message-Id: <20200212161835.28576-2-kraxel@redhat.com> In-Reply-To: <20200212161835.28576-1-kraxel@redhat.com> References: <20200212161835.28576-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Maydell , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: hXCjPzXsN6Gdoxxy3keMIQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Jan Kiszka Message-id: 20200208161048.11311-2-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index d18892d1de61..c59297ff4d2e 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1965,11 +1965,11 @@ static GtkWidget *gd_create_menu_machine(GtkDisplay= State *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 =3D gtk_widget_get_display(s->window); - GdkWindow *win =3D gtk_widget_get_window(s->window); + GdkDisplay *dpy =3D gtk_widget_get_display(window); + GdkWindow *win =3D gtk_widget_get_window(window); GdkMonitor *monitor =3D gdk_display_get_monitor_at_window(dpy, win); =20 return gdk_monitor_get_refresh_rate(monitor); @@ -2045,7 +2045,8 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, Vir= tualConsole *vc, vc->gfx.kbd =3D qkbd_state_init(con); vc->gfx.dcl.con =3D con; =20 - refresh_rate_millihz =3D gd_refresh_rate_millihz(s); + refresh_rate_millihz =3D gd_refresh_rate_millihz(vc->window ? + vc->window : s->window); if (refresh_rate_millihz) { vc->gfx.dcl.update_interval =3D MILLISEC_PER_SEC / refresh_rate_mi= llihz; } --=20 2.18.2