From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769203010578.5413997733157; Fri, 12 Jan 2018 07:00:03 -0800 (PST) Received: from localhost ([::1]:46190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0oE-00015C-S3 for importer@patchew.org; Fri, 12 Jan 2018 09:59:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0he-0003lf-J0 for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hc-0005fi-Ho for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005es-Bu for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -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 mx1.redhat.com (Postfix) with ESMTPS id 7089C61470; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54D6460C4D; Fri, 12 Jan 2018 14:52:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8BD5340834; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:50 +0100 Message-Id: <20180112145258.10578-2-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] input: fix memory leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linzhecheng , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: linzhecheng If kbd_queue is not empty and queue_count >=3D queue_limit, we should free evt. Change-Id: Ieeacf90d5e7e370a40452ec79031912d8b864d83 Signed-off-by: linzhecheng Message-id: 20171225023730.5512-1-linzhecheng@huawei.com Signed-off-by: Gerd Hoffmann --- ui/input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/input.c b/ui/input.c index 3e2d324278..e5b78aae9e 100644 --- a/ui/input.c +++ b/ui/input.c @@ -421,6 +421,8 @@ void qemu_input_event_send_key(QemuConsole *src, KeyVal= ue *key, bool down) } else if (queue_count < queue_limit) { qemu_input_queue_event(&kbd_queue, src, evt); qemu_input_queue_sync(&kbd_queue); + } else { + qapi_free_InputEvent(evt); } } =20 --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15157690345733.803641299101173; Fri, 12 Jan 2018 06:57:14 -0800 (PST) Received: from localhost ([::1]:46150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0ld-0006vp-Nk for importer@patchew.org; Fri, 12 Jan 2018 09:57:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hd-0003lV-Mb for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hc-0005fS-9k for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49468) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005eg-4c for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 266DE5D685 for ; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64560179E9; Fri, 12 Jan 2018 14:52:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 95F4C40857; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:51 +0100 Message-Id: <20180112145258.10578-3-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] ui: deprecate use of GTK 2.x in favour of 3.x series X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The GTK 3.0 release was made in Feb, 2011: https://blog.gtk.org/2011/02/10/gtk-3-0-released/ That will soon be 7 years ago, which is enough time to consider the 3.x series widely supported. Thus we deprecate the GTK 2.x support, which will allow us to delete it in the last release of 2018. By this time, GTK 3.x will be almost 8 years old. Signed-off-by: Daniel P. Berrange Message-id: 20171212113440.16483-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- configure | 6 ++++++ ui/gtk.c | 5 +++++ qemu-doc.texi | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/configure b/configure index 89bd662a6a..b272a0336b 100755 --- a/configure +++ b/configure @@ -5629,6 +5629,12 @@ if test "$sdl_too_old" =3D "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" fi =20 +if test "$gtkabi" =3D "2.0"; then + echo + echo "WARNING: Use of GTK 2.0 is deprecated and will be removed in" + echo "WARNING: future releases. Please switch to using GTK 3.0" +fi + if test "$supported_cpu" =3D "no"; then echo echo "WARNING: SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEAS= ES!" diff --git a/ui/gtk.c b/ui/gtk.c index 342e96fbe9..f3b7567984 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2248,6 +2248,11 @@ void gtk_display_init(DisplayState *ds, bool full_sc= reen, bool grab_on_hover) exit(1); } =20 +#if !GTK_CHECK_VERSION(3, 0, 0) + g_printerr("Running QEMU with GTK 2.x is deprecated, and will be remov= ed\n" + "in a future release. Please switch to GTK 3.x instead\n"); +#endif + s->window =3D gtk_window_new(GTK_WINDOW_TOPLEVEL); #if GTK_CHECK_VERSION(3, 2, 0) s->vbox =3D gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); diff --git a/qemu-doc.texi b/qemu-doc.texi index a3d2054c90..3e9eb819a6 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2587,6 +2587,15 @@ they were first deprecated in the 2.10.0 release. What follows is a list of all features currently marked as deprecated. =20 +@section Build options + +@subsection GTK 2.x + +Previously QEMU has supported building against both GTK 2.x +and 3.x series APIs. Support for the GTK 2.x builds will be +discontinued, so maintainers should switch to using GTK 3.x, +which is the default. + @section System emulator command line arguments =20 @subsection -tdf (since 1.3.0) --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515768895478760.4806432244563; Fri, 12 Jan 2018 06:54:55 -0800 (PST) Received: from localhost ([::1]:46105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0jH-0004mc-8V for importer@patchew.org; Fri, 12 Jan 2018 09:54:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hd-0003lQ-9U for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hZ-0005cX-Db for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hZ-0005by-7N for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8D905B2F6 for ; Fri, 12 Jan 2018 14:52:59 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A3CF4A6; Fri, 12 Jan 2018 14:52:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9FE0D40858; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:52 +0100 Message-Id: <20180112145258.10578-4-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 12 Jan 2018 14:52:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] spice: remove QXLWorker interface field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Frediano Ziglio Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Frediano Ziglio This fields points to an old interface that is no more used in the current code. Signed-off-by: Frediano Ziglio Message-id: 20171122135625.16625-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann --- include/ui/spice-display.h | 1 - hw/display/qxl.c | 1 - ui/spice-display.c | 2 -- 3 files changed, 4 deletions(-) diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h index aaf2019889..6b5c73b21c 100644 --- a/include/ui/spice-display.h +++ b/include/ui/spice-display.h @@ -86,7 +86,6 @@ struct SimpleSpiceDisplay { DisplayChangeListener dcl; void *buf; int bufsize; - QXLWorker *worker; QXLInstance qxl; uint32_t unique; pixman_image_t *surface; diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 99365c3e8f..b9fa067f6e 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -518,7 +518,6 @@ static void interface_attach_worker(QXLInstance *sin, Q= XLWorker *qxl_worker) PCIQXLDevice *qxl =3D container_of(sin, PCIQXLDevice, ssd.qxl); =20 trace_qxl_interface_attach_worker(qxl->id); - qxl->ssd.worker =3D qxl_worker; } =20 static void interface_set_compression_level(QXLInstance *sin, int level) diff --git a/ui/spice-display.c b/ui/spice-display.c index ad1ceafb3f..85a72fe76a 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -519,7 +519,6 @@ static void interface_attach_worker(QXLInstance *sin, Q= XLWorker *qxl_worker) SimpleSpiceDisplay *ssd =3D container_of(sin, SimpleSpiceDisplay, qxl); =20 dprint(1, "%s/%d:\n", __func__, ssd->qxl.id); - ssd->worker =3D qxl_worker; } =20 static void interface_set_compression_level(QXLInstance *sin, int level) @@ -1028,7 +1027,6 @@ static void qemu_spice_display_init_one(QemuConsole *= con) =20 ssd->qxl.base.sif =3D &dpy_interface.base; qemu_spice_add_display_interface(&ssd->qxl, con); - assert(ssd->worker); qemu_spice_create_host_memslot(ssd); =20 register_displaychangelistener(&ssd->dcl); --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515768893130863.2555305083401; Fri, 12 Jan 2018 06:54:53 -0800 (PST) Received: from localhost ([::1]:46106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0jH-0004nG-RM for importer@patchew.org; Fri, 12 Jan 2018 09:54:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hd-0003lT-DY for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hc-0005fo-IE for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59774) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005eu-Cl for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C076C051784 for ; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64AC1173CC; Fri, 12 Jan 2018 14:52:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A7CCA4085A; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:53 +0100 Message-Id: <20180112145258.10578-5-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] spice: remove unused watch list X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Frediano Ziglio Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Frediano Ziglio Signed-off-by: Frediano Ziglio Message-id: 20171122135625.16625-2-fziglio@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index ea04dc69b5..85b9ea2127 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -92,9 +92,7 @@ struct SpiceWatch { int event_mask; SpiceWatchFunc func; void *opaque; - QTAILQ_ENTRY(SpiceWatch) next; }; -static QTAILQ_HEAD(, SpiceWatch) watches =3D QTAILQ_HEAD_INITIALIZER(watch= es); =20 static void watch_read(void *opaque) { @@ -131,7 +129,6 @@ static SpiceWatch *watch_add(int fd, int event_mask, Sp= iceWatchFunc func, void * watch->fd =3D fd; watch->func =3D func; watch->opaque =3D opaque; - QTAILQ_INSERT_TAIL(&watches, watch, next); =20 watch_update_mask(watch, event_mask); return watch; @@ -140,7 +137,6 @@ static SpiceWatch *watch_add(int fd, int event_mask, Sp= iceWatchFunc func, void * static void watch_remove(SpiceWatch *watch) { qemu_set_fd_handler(watch->fd, NULL, NULL, NULL); - QTAILQ_REMOVE(&watches, watch, next); g_free(watch); } =20 --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769031508305.9519184228592; Fri, 12 Jan 2018 06:57:11 -0800 (PST) Received: from localhost ([::1]:46147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0la-0006tA-LS for importer@patchew.org; Fri, 12 Jan 2018 09:57:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0he-0003le-EK for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hd-0005gE-3E for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005fX-Sc for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0B2712E4E9 for ; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93CB63ACA; Fri, 12 Jan 2018 14:53:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AFC51409CD; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:54 +0100 Message-Id: <20180112145258.10578-6-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 12 Jan 2018 14:53:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] spice: remove only written event_mask field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Frediano Ziglio Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Frediano Ziglio Signed-off-by: Frediano Ziglio Message-id: 20171122135625.16625-3-fziglio@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 85b9ea2127..6d579faaae 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -89,7 +89,6 @@ static void timer_remove(SpiceTimer *timer) =20 struct SpiceWatch { int fd; - int event_mask; SpiceWatchFunc func; void *opaque; }; @@ -111,11 +110,10 @@ static void watch_update_mask(SpiceWatch *watch, int = event_mask) IOHandler *on_read =3D NULL; IOHandler *on_write =3D NULL; =20 - watch->event_mask =3D event_mask; - if (watch->event_mask & SPICE_WATCH_EVENT_READ) { + if (event_mask & SPICE_WATCH_EVENT_READ) { on_read =3D watch_read; } - if (watch->event_mask & SPICE_WATCH_EVENT_WRITE) { + if (event_mask & SPICE_WATCH_EVENT_WRITE) { on_write =3D watch_write; } qemu_set_fd_handler(watch->fd, on_read, on_write, watch); --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515768893907937.091801711314; Fri, 12 Jan 2018 06:54:53 -0800 (PST) Received: from localhost ([::1]:46103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0jG-0004lP-CV for importer@patchew.org; Fri, 12 Jan 2018 09:54:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hd-0003lR-9l for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hc-0005fC-7Q for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005eY-0e for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14B27DF3E for ; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98A5717D37; Fri, 12 Jan 2018 14:53:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B7B0E409D2; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:55 +0100 Message-Id: <20180112145258.10578-7-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] spice: remove unused timer list X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Frediano Ziglio Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Frediano Ziglio Signed-off-by: Frediano Ziglio Message-id: 20171122135625.16625-4-fziglio@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 6d579faaae..2baf0c7120 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -55,9 +55,7 @@ static QemuThread me; =20 struct SpiceTimer { QEMUTimer *timer; - QTAILQ_ENTRY(SpiceTimer) next; }; -static QTAILQ_HEAD(, SpiceTimer) timers =3D QTAILQ_HEAD_INITIALIZER(timers= ); =20 static SpiceTimer *timer_add(SpiceTimerFunc func, void *opaque) { @@ -65,7 +63,6 @@ static SpiceTimer *timer_add(SpiceTimerFunc func, void *o= paque) =20 timer =3D g_malloc0(sizeof(*timer)); timer->timer =3D timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque); - QTAILQ_INSERT_TAIL(&timers, timer, next); return timer; } =20 @@ -83,7 +80,6 @@ static void timer_remove(SpiceTimer *timer) { timer_del(timer->timer); timer_free(timer->timer); - QTAILQ_REMOVE(&timers, timer, next); g_free(timer); } =20 --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769572593652.1983739600998; Fri, 12 Jan 2018 07:06:12 -0800 (PST) Received: from localhost ([::1]:46487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0u8-0007d7-4F for importer@patchew.org; Fri, 12 Jan 2018 10:06:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hg-0003nM-Hx for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hf-0005j6-Fb for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hf-0005iH-7o for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4997D85550; Fri, 12 Jan 2018 14:53:06 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56D9B909EF; Fri, 12 Jan 2018 14:53:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BF90241ABE; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:56 +0100 Message-Id: <20180112145258.10578-8-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 12 Jan 2018 14:53:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] sdl2: Do not hide the cursor on auxilliary windows X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jindrich Makovicka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jindrich Makovicka Signed-off-by: Jindrich Makovicka Message-Id: <20171117112258.5888-2-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 8718cf36b5..62a75318dd 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -466,6 +466,10 @@ static void handle_mousemotion(SDL_Event *ev) int max_x, max_y; struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (qemu_input_is_absolute() || absolute_enabled) { int scr_w, scr_h; SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h); @@ -494,6 +498,10 @@ static void handle_mousebutton(SDL_Event *ev) SDL_MouseButtonEvent *bev; struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + bev =3D &ev->button; if (!gui_grab && !qemu_input_is_absolute()) { if (ev->type =3D=3D SDL_MOUSEBUTTONUP && bev->button =3D=3D SDL_BU= TTON_LEFT) { @@ -516,6 +524,10 @@ static void handle_mousewheel(SDL_Event *ev) SDL_MouseWheelEvent *wev =3D &ev->wheel; InputButton btn; =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (wev->y > 0) { btn =3D INPUT_BUTTON_WHEEL_UP; } else if (wev->y < 0) { @@ -657,6 +669,11 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, int x, int y, int on) { struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); + + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (on) { if (!guest_cursor) { sdl_show_cursor(); --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769201474239.73948421455884; Fri, 12 Jan 2018 07:00:01 -0800 (PST) Received: from localhost ([::1]:46192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0oH-00016q-RI for importer@patchew.org; Fri, 12 Jan 2018 09:59:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hf-0003mP-Qv for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hd-0005g2-0E for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005fE-QD for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC87CA49E7; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57FF66046B; Fri, 12 Jan 2018 14:53:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C76E8980C6; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:57 +0100 Message-Id: <20180112145258.10578-9-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] sdl2 uses surface relative coordinates X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jindrich Makovicka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jindrich Makovicka This patch fixes mouse positioning with -device usb-tablet and fullscreen or resized window. Fixes: 46522a82236ea0cf9011b89896d2d8f8ddaf2443 Signed-off-by: Jindrich Makovicka Message-Id: <20171117112258.5888-3-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 62a75318dd..8a0bd9149b 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -276,32 +276,10 @@ static void sdl_send_mouse_event(struct sdl2_console = *scon, int dx, int dy, } =20 if (qemu_input_is_absolute()) { - int scr_w, scr_h; - int max_w =3D 0, max_h =3D 0; - int off_x =3D 0, off_y =3D 0; - int cur_off_x =3D 0, cur_off_y =3D 0; - int i; - - for (i =3D 0; i < sdl2_num_outputs; i++) { - struct sdl2_console *thiscon =3D &sdl2_console[i]; - if (thiscon->real_window && thiscon->surface) { - SDL_GetWindowSize(thiscon->real_window, &scr_w, &scr_h); - cur_off_x =3D thiscon->x; - cur_off_y =3D thiscon->y; - if (scr_w + cur_off_x > max_w) { - max_w =3D scr_w + cur_off_x; - } - if (scr_h + cur_off_y > max_h) { - max_h =3D scr_h + cur_off_y; - } - if (i =3D=3D scon->idx) { - off_x =3D cur_off_x; - off_y =3D cur_off_y; - } - } - } - qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, 0, ma= x_w); - qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, 0, ma= x_h); + qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, + x, 0, surface_width(scon->surface)); + qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, + y, 0, surface_height(scon->surface)); } else { if (guest_cursor) { x -=3D guest_x; --=20 2.9.3 From nobody Thu Apr 18 15:47:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151576938848376.14309766686813; Fri, 12 Jan 2018 07:03:08 -0800 (PST) Received: from localhost ([::1]:46374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0rL-00049x-JU for importer@patchew.org; Fri, 12 Jan 2018 10:03:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hf-0003m1-Bk for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hd-0005h9-S9 for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57526) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hd-0005fy-Hc for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:05 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CBCC2BC0; Fri, 12 Jan 2018 14:53:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67B8A5D962; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D06E9980CA; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:58 +0100 Message-Id: <20180112145258.10578-10-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 Jan 2018 14:53:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jindrich Makovicka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jindrich Makovicka When SDL2 windows change focus while a key is held, the window that receives the focus also receives a new KeyDown event, without an autorepeat flag. This means that if a WM places the qemu console over the main window after Ctrl-Alt-2, the console closes immediately after opening. Then, the main window receives the KeyDown event again and the whole process repeats. This patch makes the SDL2 UI ignore the KeyDown events on a window that just received the focus, if the GUI modifier was held. The ignore flag is reset on a first KeyUp event. This effectively works around the issue above. Signed-off-by: Jindrich Makovicka Message-Id: <20171117112258.5888-4-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- include/ui/sdl2.h | 1 + ui/sdl2.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index b29cf803c9..51084e6320 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -24,6 +24,7 @@ struct sdl2_console { int opengl; int updates; int idle_counter; + int ignore_hotkeys; SDL_GLContext winctx; #ifdef CONFIG_OPENGL QemuGLShader *gls; diff --git a/ui/sdl2.c b/ui/sdl2.c index 8a0bd9149b..89c6a2633c 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -312,22 +312,28 @@ static void toggle_full_screen(struct sdl2_console *s= con) sdl2_redraw(scon); } =20 -static void handle_keydown(SDL_Event *ev) +static int get_mod_state(void) { - int mod_state, win; - struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); + SDL_Keymod mod =3D SDL_GetModState(); =20 if (alt_grab) { - mod_state =3D (SDL_GetModState() & (gui_grab_code | KMOD_LSHIFT)) = =3D=3D + return (mod & (gui_grab_code | KMOD_LSHIFT)) =3D=3D (gui_grab_code | KMOD_LSHIFT); } else if (ctrl_grab) { - mod_state =3D (SDL_GetModState() & KMOD_RCTRL) =3D=3D KMOD_RCTRL; + return (mod & KMOD_RCTRL) =3D=3D KMOD_RCTRL; } else { - mod_state =3D (SDL_GetModState() & gui_grab_code) =3D=3D gui_grab_= code; + return (mod & gui_grab_code) =3D=3D gui_grab_code; } - gui_key_modifier_pressed =3D mod_state; +} =20 - if (gui_key_modifier_pressed) { +static void handle_keydown(SDL_Event *ev) +{ + int win; + struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); + + gui_key_modifier_pressed =3D get_mod_state(); + + if (!scon->ignore_hotkeys && gui_key_modifier_pressed && !ev->key.repe= at) { switch (ev->key.keysym.scancode) { case SDL_SCANCODE_2: case SDL_SCANCODE_3: @@ -401,6 +407,8 @@ static void handle_keyup(SDL_Event *ev) int mod_state; struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); =20 + scon->ignore_hotkeys =3D false; + if (!alt_grab) { mod_state =3D (ev->key.keysym.mod & gui_grab_code); } else { @@ -547,6 +555,14 @@ static void handle_windowevent(SDL_Event *ev) if (!gui_grab && (qemu_input_is_absolute() || absolute_enabled)) { absolute_mouse_grab(scon); } + /* If a new console window opened using a hotkey receives the + * focus, SDL sends another KEYDOWN event to the new window, + * closing the console window immediately after. + * + * Work around this by ignoring further hotkey events until a + * key is released. + */ + scon->ignore_hotkeys =3D get_mod_state(); break; case SDL_WINDOWEVENT_FOCUS_LOST: if (gui_grab && !gui_fullscreen) { --=20 2.9.3