From nobody Thu Apr 25 15:40:13 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652291642; cv=none; d=zohomail.com; s=zohoarc; b=UY3WD+T4vkxJlzpZJlQgji58VFK2X079Chi1jfpQWPDVknCPdcHQAGGrekQs7ps+ac70eYTPv8JhZioodN453DXSUyzAPRIBr4XTguUYeTq7HhDUa32S04JCZiKPpOBIsgCI32DzuUcME5xjrmwavBR6AqKTltVvIZfyI5EaNLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652291642; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ucByN49ZKXpiyo23A22z7u1QCV7sN0pz7kp7jU9Jo5w=; b=NSG+UpGK3PT+bbTPt4tCsTxB3OFcHsaSWeO6nFocM7AhIyZ10jewNtNEjm5gTxc7JwGz3Dmz/J8q3FuoaYHLkYzdncsHJzUwgzhYOPLeilU/y/mRjvcFUGD1C366iDvEH2fzP8RSLlVjpC36FvgMLfmjsP/7AU91EE2DH4BeJlQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652291642693425.8194279418643; Wed, 11 May 2022 10:54:02 -0700 (PDT) Received: from localhost ([::1]:55382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noqXB-0004Rq-Jy for importer2@patchew.org; Wed, 11 May 2022 13:54:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVF-0002Et-JD for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVD-0004fe-NZ for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:01 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-nqUgORaJN12QFtD3zfv2gA-1; Wed, 11 May 2022 13:51:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2351B801210 for ; Wed, 11 May 2022 17:51:54 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9633640CF8EB; Wed, 11 May 2022 17:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652291515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ucByN49ZKXpiyo23A22z7u1QCV7sN0pz7kp7jU9Jo5w=; b=TX3gBonTAog/CAlFYEYsIj8AcxIvVMxe5Sd3MyWwXmXwSsyB7ppitKFM9E2Re37rYgSHxR cWQ8YHx/RP03QP+8zT0edJVBbJCzCCodO4wHWj9Upr3Yi+diaKrqmnsOToB3zx81aG2Jrn t9FemYfwBpRGYQu/MV29un2h4ZddnDI= X-MC-Unique: nqUgORaJN12QFtD3zfv2gA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini , libvir-list@redhat.com Subject: [PATCH 1/3] ui: Remove deprecated parameters of the "-display sdl" option Date: Wed, 11 May 2022 19:51:45 +0200 Message-Id: <20220511175147.917707-2-thuth@redhat.com> In-Reply-To: <20220511175147.917707-1-thuth@redhat.com> References: <20220511175147.917707-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652291643396100001 Content-Type: text/plain; charset="utf-8" These parameters are in the way for further refactoring (since they use an underscore in the name which is forbidden in QAPI), so let's remove these now that their deprecation period is over. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/about/deprecated.rst | 16 ------------- docs/about/removed-features.rst | 17 ++++++++++++++ softmmu/vl.c | 41 +-------------------------------- qemu-options.hx | 32 ++----------------------- 4 files changed, 20 insertions(+), 86 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 896e5a97ab..ce7a5b97fc 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -109,22 +109,6 @@ other options have been processed. This will either h= ave no effect (if if they were not given. The property is therefore useless and should not = be specified. =20 -``-display sdl,window_close=3D...`` (since 6.1) -''''''''''''''''''''''''''''''''''''''''''''' - -Use ``-display sdl,window-close=3D...`` instead (i.e. with a minus instead= of -an underscore between "window" and "close"). - -``-alt-grab`` and ``-display sdl,alt_grab=3Don`` (since 6.2) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Use ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` instead. - -``-ctrl-grab`` and ``-display sdl,ctrl_grab=3Don`` (since 6.2) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Use ``-display sdl,grab-mod=3Drctrl`` instead. - ``-sdl`` (since 6.2) '''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 4a0b270296..51bfc844f6 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -355,6 +355,23 @@ The ``-writeconfig`` option was not able to serialize = the entire contents of the QEMU command line. It is thus considered a failed experiment and removed without a replacement. =20 +``-display sdl,window_close=3D...`` (removed in 7.1) +'''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,window-close=3D...`` instead (i.e. with a minus instead= of +an underscore between "window" and "close"). + +``-alt-grab`` and ``-display sdl,alt_grab=3Don`` (removed in 7.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` instead. + +``-ctrl-grab`` and ``-display sdl,ctrl_grab=3Don`` (removed in 7.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,grab-mod=3Drctrl`` instead. + + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index 488cc4d09e..fdf797270c 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1068,32 +1068,7 @@ static void parse_display(const char *p) } else { goto invalid_sdl_args; } - } else if (strstart(opts, ",alt_grab=3D", &nextopt)) { - opts =3D nextopt; - if (strstart(opts, "on", &nextopt)) { - alt_grab =3D 1; - } else if (strstart(opts, "off", &nextopt)) { - alt_grab =3D 0; - } else { - goto invalid_sdl_args; - } - warn_report("alt_grab is deprecated, use grab-mod instead.= "); - } else if (strstart(opts, ",ctrl_grab=3D", &nextopt)) { - opts =3D nextopt; - if (strstart(opts, "on", &nextopt)) { - ctrl_grab =3D 1; - } else if (strstart(opts, "off", &nextopt)) { - ctrl_grab =3D 0; - } else { - goto invalid_sdl_args; - } - warn_report("ctrl_grab is deprecated, use grab-mod instead= ."); - } else if (strstart(opts, ",window_close=3D", &nextopt) || - strstart(opts, ",window-close=3D", &nextopt)) { - if (strstart(opts, ",window_close=3D", NULL)) { - warn_report("window_close with an underscore is deprec= ated," - " please use window-close instead."); - } + } else if (strstart(opts, ",window-close=3D", &nextopt)) { opts =3D nextopt; dpy.has_window_close =3D true; if (strstart(opts, "on", &nextopt)) { @@ -1943,10 +1918,6 @@ static void qemu_create_early_backends(void) const bool use_gtk =3D false; #endif =20 - if ((alt_grab || ctrl_grab) && !use_sdl) { - error_report("-alt-grab and -ctrl-grab are only valid " - "for SDL, ignoring option"); - } if (dpy.has_window_close && !use_gtk && !use_sdl) { error_report("window-close is only valid for GTK and SDL, " "ignoring option"); @@ -3302,16 +3273,6 @@ void qemu_init(int argc, char **argv, char **envp) dpy.has_full_screen =3D true; dpy.full_screen =3D true; break; - case QEMU_OPTION_alt_grab: - alt_grab =3D 1; - warn_report("-alt-grab is deprecated, please use " - "-display sdl,grab-mod=3Dlshift-lctrl-lalt ins= tead."); - break; - case QEMU_OPTION_ctrl_grab: - ctrl_grab =3D 1; - warn_report("-ctrl-grab is deprecated, please use " - "-display sdl,grab-mod=3Drctrl instead."); - break; case QEMU_OPTION_sdl: warn_report("-sdl is deprecated, use -display sdl instead.= "); #ifdef CONFIG_SDL diff --git a/qemu-options.hx b/qemu-options.hx index 796229c433..0fa873d088 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1903,8 +1903,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, "-display spice-app[,gl=3Don|off]\n" #endif #if defined(CONFIG_SDL) - "-display sdl[,alt_grab=3Don|off][,ctrl_grab=3Don|off][,gl=3Don|core|e= s|off]\n" - " [,grab-mod=3D][,show-cursor=3Don|off][,window-close= =3Don|off]\n" + "-display sdl[,gl=3Don|core|es|off][,grab-mod=3D][,show-cursor=3D= on|off]\n" + " [,window-close=3Don|off]\n" #endif #if defined(CONFIG_GTK) "-display gtk[,full-screen=3Don|off][,gl=3Don|off][,grab-on-hover=3Don= |off]\n" @@ -1977,12 +1977,6 @@ SRST the mouse grabbing in conjunction with the "g" key. ```` can= be either ``lshift-lctrl-lalt`` or ``rctrl``. =20 - ``alt_grab=3Don|off`` : Use Control+Alt+Shift-g to toggle mouse gr= abbing. - This parameter is deprecated - use ``grab-mod`` instead. - - ``ctrl_grab=3Don|off`` : Use Right-Control-g to toggle mouse grabb= ing. - This parameter is deprecated - use ``grab-mod`` instead. - ``gl=3Don|off|core|es`` : Use OpenGL for displaying =20 ``show-cursor=3Don|off`` : Force showing the mouse cursor @@ -2068,28 +2062,6 @@ SRST is displayed in graphical mode. ERST =20 -DEF("alt-grab", 0, QEMU_OPTION_alt_grab, - "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt= )\n", - QEMU_ARCH_ALL) -SRST -``-alt-grab`` - Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that - this also affects the special keys (for fullscreen, monitor-mode - switching, etc). This option is deprecated - please use - ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` instead. -ERST - -DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, - "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n", - QEMU_ARCH_ALL) -SRST -``-ctrl-grab`` - Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this - also affects the special keys (for fullscreen, monitor-mode - switching, etc). This option is deprecated - please use - ``-display sdl,grab-mod=3Drctrl`` instead. -ERST - DEF("sdl", 0, QEMU_OPTION_sdl, "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL) SRST --=20 2.27.0 From nobody Thu Apr 25 15:40:13 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652291916; cv=none; d=zohomail.com; s=zohoarc; b=bzvrSswvAimKDaw0b/DpHpgT3vywGo3vF98+Oz3Z1ApvqiTL2mdWCA2EFXhuW8ax2YebHcDsW/599tSwuJ/+HGXxyA21Dq/Ect+6u8szusb6b40FPvUohkK454iZko4VS2zRT0LjyTS/CXuCp5UxwgZhK8GlHS0zEJacgooR+Ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652291916; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7vHNTpZp+aJW+NFWmBiJyOFUdNmlx3lbxDvIdtsf2AA=; b=l2Lzp7tP5yNvRGv6+TgfhSl1HhLgBwd6Jmy5nW3DetPCHU59xIaX6U8StXa8TDlr6brUO8or4/M1cS6J6pqe4kdIv1FZ869ZjJBOoc6y3c7UIl+unxY4XkbZmvZTTXFR89TsYorgjc7uTeUutoESPf1Ddch9V0akY0a9626ejB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652291916600775.0353351545801; Wed, 11 May 2022 10:58:36 -0700 (PDT) Received: from localhost ([::1]:36248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noqbb-0002Im-5o for importer2@patchew.org; Wed, 11 May 2022 13:58:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVH-0002Jw-26 for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVD-0004fp-QB for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:02 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-394-3Wft9hYpMlyhf7UlV5Rp9Q-1; Wed, 11 May 2022 13:51:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0471386B8B2 for ; Wed, 11 May 2022 17:51:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71F9340CF8E4; Wed, 11 May 2022 17:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652291517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7vHNTpZp+aJW+NFWmBiJyOFUdNmlx3lbxDvIdtsf2AA=; b=GD4FyNaBXRo1KRpoVR3nT8Bjs9NEl93etGimqE1AC7py0KkXBpDQU9yqM/LkUFrwodTMsD X0pVV8NFhV52pYBCUYDYQ6+eXgrCDUpF8hFJ+JwVeUeAPbwS0txTJ+AiDo3lTMAH8DiCJl SlCy/cydxNEphf9vYhlyQtMq32BMcdY= X-MC-Unique: 3Wft9hYpMlyhf7UlV5Rp9Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini , libvir-list@redhat.com Subject: [PATCH 2/3] ui: Switch "-display sdl" to use the QAPI parser Date: Wed, 11 May 2022 19:51:46 +0200 Message-Id: <20220511175147.917707-3-thuth@redhat.com> In-Reply-To: <20220511175147.917707-1-thuth@redhat.com> References: <20220511175147.917707-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652291916837100001 Content-Type: text/plain; charset="utf-8" The "-display sdl" option still uses a hand-crafted parser for its parameters since some of them used underscores which is forbidden in QAPI. Now that the problematic parameters have been removed, we can switch to use the QAPI parser instead. This introduces the new "DisplaySDL" QAPI struct that is used to hold the parameters that are unique to the SDL display. The only specific parameter is currently "grab-mod" which is modeled as a string, so that it could be extended for other arbitrary modifiers later more easily. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/ui.json | 17 +++++++++- include/sysemu/sysemu.h | 2 -- softmmu/globals.c | 2 -- softmmu/vl.c | 70 +---------------------------------------- ui/sdl2.c | 13 ++++++++ 5 files changed, 30 insertions(+), 74 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 059302a5ef..511ade44f2 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1309,6 +1309,20 @@ '*swap-opt-cmd': 'bool' } } =20 +## +# @DisplaySDL: +# +# SDL2 display options. +# +# @grab-mod: String with modifier keys that should be pressed together wi= th +# the "G" key to release the mouse grab. Only "lshift-lctrl-la= lt" +# and "rctrl" are currently supported. +# +# Since: 7.1 +## +{ 'struct' : 'DisplaySDL', + 'data' : { '*grab-mod' : 'str' } } + ## # @DisplayType: # @@ -1391,7 +1405,8 @@ 'curses': { 'type': 'DisplayCurses', 'if': 'CONFIG_CURSES' }, 'egl-headless': { 'type': 'DisplayEGLHeadless', 'if': { 'all': ['CONFIG_OPENGL', 'CONFIG_GBM'] } }, - 'dbus': { 'type': 'DisplayDBus', 'if': 'CONFIG_DBUS_DISPLAY' } + 'dbus': { 'type': 'DisplayDBus', 'if': 'CONFIG_DBUS_DISPLAY' }, + 'sdl': { 'type': 'DisplaySDL', 'if': 'CONFIG_SDL' } } } =20 diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 360a408edf..7cca797450 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -42,8 +42,6 @@ extern int graphic_depth; extern int display_opengl; extern const char *keyboard_layout; extern int win2k_install_hack; -extern int alt_grab; -extern int ctrl_grab; extern int graphic_rotate; extern int old_param; extern int boot_menu; diff --git a/softmmu/globals.c b/softmmu/globals.c index 98b64e0492..12611c2a7a 100644 --- a/softmmu/globals.c +++ b/softmmu/globals.c @@ -50,8 +50,6 @@ QEMUOptionRom option_rom[MAX_OPTION_ROMS]; int nb_option_roms; int old_param; const char *qemu_name; -int alt_grab; -int ctrl_grab; unsigned int nb_prom_envs; const char *prom_envs[MAX_PROM_ENVS]; int boot_menu; diff --git a/softmmu/vl.c b/softmmu/vl.c index fdf797270c..90a0a4d393 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1045,75 +1045,7 @@ static void parse_display(const char *p) exit(0); } =20 - if (strstart(p, "sdl", &opts)) { - /* - * sdl DisplayType needs hand-crafted parser instead of - * parse_display_qapi() due to some options not in - * DisplayOptions, specifically: - * - ctrl_grab + alt_grab - * They can't be moved into the QAPI since they use underscore= s, - * thus they will get replaced by "grab-mod" in the long term - */ -#if defined(CONFIG_SDL) - dpy.type =3D DISPLAY_TYPE_SDL; - while (*opts) { - const char *nextopt; - - if (strstart(opts, ",grab-mod=3D", &nextopt)) { - opts =3D nextopt; - if (strstart(opts, "lshift-lctrl-lalt", &nextopt)) { - alt_grab =3D 1; - } else if (strstart(opts, "rctrl", &nextopt)) { - ctrl_grab =3D 1; - } else { - goto invalid_sdl_args; - } - } else if (strstart(opts, ",window-close=3D", &nextopt)) { - opts =3D nextopt; - dpy.has_window_close =3D true; - if (strstart(opts, "on", &nextopt)) { - dpy.window_close =3D true; - } else if (strstart(opts, "off", &nextopt)) { - dpy.window_close =3D false; - } else { - goto invalid_sdl_args; - } - } else if (strstart(opts, ",show-cursor=3D", &nextopt)) { - opts =3D nextopt; - dpy.has_show_cursor =3D true; - if (strstart(opts, "on", &nextopt)) { - dpy.show_cursor =3D true; - } else if (strstart(opts, "off", &nextopt)) { - dpy.show_cursor =3D false; - } else { - goto invalid_sdl_args; - } - } else if (strstart(opts, ",gl=3D", &nextopt)) { - opts =3D nextopt; - dpy.has_gl =3D true; - if (strstart(opts, "on", &nextopt)) { - dpy.gl =3D DISPLAYGL_MODE_ON; - } else if (strstart(opts, "core", &nextopt)) { - dpy.gl =3D DISPLAYGL_MODE_CORE; - } else if (strstart(opts, "es", &nextopt)) { - dpy.gl =3D DISPLAYGL_MODE_ES; - } else if (strstart(opts, "off", &nextopt)) { - dpy.gl =3D DISPLAYGL_MODE_OFF; - } else { - goto invalid_sdl_args; - } - } else { - invalid_sdl_args: - error_report("invalid SDL option string"); - exit(1); - } - opts =3D nextopt; - } -#else - error_report("SDL display supported is not available in this binar= y"); - exit(1); -#endif - } else if (strstart(p, "vnc", &opts)) { + if (strstart(p, "vnc", &opts)) { /* * vnc isn't a (local) DisplayType but a protocol for remote * display access. diff --git a/ui/sdl2.c b/ui/sdl2.c index d3741f9b75..18c63e1fc9 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -40,6 +40,8 @@ static struct sdl2_console *sdl2_console; =20 static SDL_Surface *guest_sprite_surface; static int gui_grab; /* if true, all keyboard/mouse events are grabbed */ +static bool alt_grab; +static bool ctrl_grab; =20 static int gui_saved_grab; static int gui_fullscreen; @@ -853,6 +855,17 @@ static void sdl2_display_init(DisplayState *ds, Displa= yOptions *o) =20 gui_fullscreen =3D o->has_full_screen && o->full_screen; =20 + if (o->u.sdl.has_grab_mod) { + if (g_str_equal(o->u.sdl.grab_mod, "lshift-lctrl-lalt")) { + alt_grab =3D true; + } else if (g_str_equal(o->u.sdl.grab_mod, "rctrl")) { + ctrl_grab =3D true; + } else { + error_report("Unsupported grab-mod: %s", o->u.sdl.grab_mod); + exit(1); + } + } + for (i =3D 0;; i++) { QemuConsole *con =3D qemu_console_lookup_by_index(i); if (!con) { --=20 2.27.0 From nobody Thu Apr 25 15:40:13 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652291775; cv=none; d=zohomail.com; s=zohoarc; b=TyQ/UqrRipP1KZW3HuoKdCqfj9KdCQpI5SwXRvDL/n5nUwJFjv5U2oaH4D4MmANaPnqsD/p1GjRjZQ6J9XWM99+jZi3XJ7wj9RBA7ITCkG8fts23s3ovMSSRfjjbDC0r0yQ7hM0swVpF00ugIK9E1nkDy0Vv3+tHl4SrJQa2ijk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652291775; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w1Qa8eWiKw7oxT4a4786YMEFlQyElPX/kzcM6YGI3EA=; b=jlulB13360wBsEKH61vRuIC2enbFC90bWYFPDiF4q1dr3AXl8xTzHGG2qgnR5JYs5Z2O3fnlgNa6Zll14EHHVM9ck5PNRWC5lssvi40Laq04fsUvtCz/O01Mrw+qS7uGt8xvRCewO9U9c0fz6aF+tmEmDasz80Dfwo/Yr+o5JU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652291775646695.8789939749565; Wed, 11 May 2022 10:56:15 -0700 (PDT) Received: from localhost ([::1]:58902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noqZK-0006pF-Fs for importer2@patchew.org; Wed, 11 May 2022 13:56:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVI-0002Q2-NQ for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noqVG-0004gD-VL for qemu-devel@nongnu.org; Wed, 11 May 2022 13:52:04 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-150-jugtt2tdOc-rqoCeyagomA-1; Wed, 11 May 2022 13:51:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1EA8101A52C for ; Wed, 11 May 2022 17:51:57 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59A2B400E872; Wed, 11 May 2022 17:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652291521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w1Qa8eWiKw7oxT4a4786YMEFlQyElPX/kzcM6YGI3EA=; b=aZu5i7MYZ2dm3/ODD5R6wch/ut5g5TZjSs+orHqGIqm1YT6vVwXUgBMCYnM2ZW1fIFMlkT Tz0jKmZKqEHGPU0AnMttyIA89IkJvKsweQEjhz2zivxAtSKupVeQCUdLsuSjXGmMcPQJDY JQSWnszyXniqS4agC4MGua5K49bgIVY= X-MC-Unique: jugtt2tdOc-rqoCeyagomA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini , libvir-list@redhat.com Subject: [PATCH 3/3] ui: Remove deprecated options "-sdl" and "-curses" Date: Wed, 11 May 2022 19:51:47 +0200 Message-Id: <20220511175147.917707-4-thuth@redhat.com> In-Reply-To: <20220511175147.917707-1-thuth@redhat.com> References: <20220511175147.917707-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652291776075100001 Content-Type: text/plain; charset="utf-8" We have "-sdl" and "-curses", but no "-gtk" and no "-cocoa" ... these old-style options are rather confusing than helpful nowadays. Now that the deprecation period is over, let's remove them, so we get a cleaner interface (where "-display" is the only way to select the user interface). Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/about/deprecated.rst | 10 ---------- docs/about/removed-features.rst | 10 ++++++++++ softmmu/vl.c | 19 ------------------- qemu-options.hx | 24 ++---------------------- 4 files changed, 12 insertions(+), 51 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index ce7a5b97fc..0ed0e9cb13 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -109,16 +109,6 @@ other options have been processed. This will either h= ave no effect (if if they were not given. The property is therefore useless and should not = be specified. =20 -``-sdl`` (since 6.2) -'''''''''''''''''''' - -Use ``-display sdl`` instead. - -``-curses`` (since 6.2) -''''''''''''''''''''''' - -Use ``-display curses`` instead. - ``-watchdog`` (since 6.2) ''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 51bfc844f6..0d5ffb353e 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -371,6 +371,16 @@ Use ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` inst= ead. =20 Use ``-display sdl,grab-mod=3Drctrl`` instead. =20 +``-sdl`` (removed in 7.1) +''''''''''''''''''''''''' + +Use ``-display sdl`` instead. + +``-curses`` (removed in 7.1) +'''''''''''''''''''''''''''' + +Use ``-display curses`` instead. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/softmmu/vl.c b/softmmu/vl.c index 90a0a4d393..9887c71791 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2845,16 +2845,6 @@ void qemu_init(int argc, char **argv, char **envp) nographic =3D true; dpy.type =3D DISPLAY_TYPE_NONE; break; - case QEMU_OPTION_curses: - warn_report("-curses is deprecated, " - "use -display curses instead."); -#ifdef CONFIG_CURSES - dpy.type =3D DISPLAY_TYPE_CURSES; -#else - error_report("curses or iconv support is disabled"); - exit(1); -#endif - break; case QEMU_OPTION_portrait: graphic_rotate =3D 90; break; @@ -3205,15 +3195,6 @@ void qemu_init(int argc, char **argv, char **envp) dpy.has_full_screen =3D true; dpy.full_screen =3D true; break; - case QEMU_OPTION_sdl: - warn_report("-sdl is deprecated, use -display sdl instead.= "); -#ifdef CONFIG_SDL - dpy.type =3D DISPLAY_TYPE_SDL; - break; -#else - error_report("SDL support is disabled"); - exit(1); -#endif case QEMU_OPTION_pidfile: pid_file =3D optarg; break; diff --git a/qemu-options.hx b/qemu-options.hx index 0fa873d088..1abf3e500f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1946,9 +1946,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, , QEMU_ARCH_ALL) SRST ``-display type`` - Select type of display to use. This option is a replacement for the - old style -sdl/-curses/... options. Use ``-display help`` to list - the available display types. Valid values for type are + Select type of display to use. Use ``-display help`` to list the avail= able + display types. Valid values for type are =20 ``spice-app[,gl=3Don|off]`` Start QEMU as a Spice server and launch the default Spice client @@ -2050,25 +2049,6 @@ SRST Use C-a h for help on switching between the console and monitor. ERST =20 -DEF("curses", 0, QEMU_OPTION_curses, - "-curses shorthand for -display curses\n", - QEMU_ARCH_ALL) -SRST -``-curses`` - Normally, if QEMU is compiled with graphical window support, it - displays output such as guest graphics, guest console, and the QEMU - monitor in a window. With this option, QEMU can display the VGA - output when in text mode using a curses/ncurses interface. Nothing - is displayed in graphical mode. -ERST - -DEF("sdl", 0, QEMU_OPTION_sdl, - "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL) -SRST -``-sdl`` - Enable SDL. -ERST - #ifdef CONFIG_SPICE DEF("spice", HAS_ARG, QEMU_OPTION_spice, "-spice [port=3Dport][,tls-port=3Dsecured-port][,x509-dir=3D]\n" --=20 2.27.0