From nobody Sun May 19 22:50:26 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=1652977443; cv=none; d=zohomail.com; s=zohoarc; b=KBZllcT0NGcDcV1OJyYZBCbU2r9KYlQYJp30UREjWg7rBjjAwqwqjuV/fBBlOXaQ68zkrJ87lb3FjDvA3s1/lTdFE0w4ltEgCpz1S67LXG+bd5IYU2Rp99sYya8Q/RZ7TG7WE7Y12ImVKJmaf8SYpkDE0wg3BARD/+s9Go/Uu0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652977443; h=Content-Type: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=PuoKonwi4ea8DjA+TbiypqNitrSbcQvzjIJkVp9vv+c=; b=BJF3EIj59Rwvoch3uAefY5xd/NjFs0RNSOp621YMIeCXpT57AL4I/LctzVAhrExK9ebtqFYm7eLuQWy4mYubhCS8B2hPHxt2mBIGq/egja+KosvcOpEpfvMKr2INOt4ezaS0zfd3JeIG8uNXLt/sSBDXWTM5FIVuPNYUEa8IajY= 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 1652977443065104.31565198354588; Thu, 19 May 2022 09:24:03 -0700 (PDT) Received: from localhost ([::1]:59572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nriwT-0008Vb-Dy for importer2@patchew.org; Thu, 19 May 2022 12:24:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriWB-0007Rj-20 for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriVv-00031f-OS for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:50 -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-554-L-xu0UWoN_6JmjDO2l2DBw-1; Thu, 19 May 2022 11:56:32 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7381185A5AA for ; Thu, 19 May 2022 15:56:32 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6249401E74; Thu, 19 May 2022 15:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652975793; h=from:from: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; bh=PuoKonwi4ea8DjA+TbiypqNitrSbcQvzjIJkVp9vv+c=; b=NlGm7V+UpPsYIHrfmaGFEl6hAWs8K7gRVl4MQwvpgLqa2WKAAl/YBA4g0B7ZoSHy29MRCG fPHUh4N4EhPTligjnwYTZV/W1VtIwiwuMtvO78deOsABIM0UemXUaJ8J36tiHpPeILRApZ 26UhlnImfNca2VMz4S+u2/M+yfVewHw= X-MC-Unique: L-xu0UWoN_6JmjDO2l2DBw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini Subject: [PATCH v3 1/3] ui: Remove deprecated parameters of the "-display sdl" option Date: Thu, 19 May 2022 17:56:23 +0200 Message-Id: <20220519155625.1414365-2-thuth@redhat.com> In-Reply-To: <20220519155625.1414365-1-thuth@redhat.com> References: <20220519155625.1414365-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: 1652977444258100001 Dropping these deprecated parameters simplifies further refactoring (e.g. QAPIfication is easier without underscores in the name). Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth --- 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 a92ae0f162..562a133f18 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -81,22 +81,6 @@ the process listing. This is replaced by the new ``passw= ord-secret`` option which lets the password be securely provided on the command line using a ``secret`` object instance. =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 eb76974347..4c9e001c35 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -370,6 +370,23 @@ The ``opened=3Don`` option in the command line or QMP = ``object-add`` either had no effect (if ``opened`` was the last option) or caused errors. The prope= rty is therefore useless and should simply be removed. =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 84a31eba76..57ab9d5322 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1079,32 +1079,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)) { @@ -1962,10 +1937,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"); @@ -3273,16 +3244,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 a664baaa18..726e437a97 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1938,8 +1938,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" @@ -2012,12 +2012,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 @@ -2103,28 +2097,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 Sun May 19 22:50:26 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=1652975947; cv=none; d=zohomail.com; s=zohoarc; b=Yp1N1ccAfN4AS8OtolN3hC+Y/kbJTuY4G3v+rKJJv2ykg26CY7v5xBBGg2tqNxd929iMRXBbp7USBVSoJkrW//o8ItRpKLrLbzqUazBfrUhGKE+LF47uPUSfHUbnDI4UDylv0ygenuSt6qLibL9l6VjxJI46hKkIegcBRu+1Q7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652975947; 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=RqRl+ljAGvE6MiJ+r5v6CGsQkAGcUX56c8fJnhEImgQ=; b=hjeoSQK0rdQAldRNovSkuGN6vayh5mvXF/0O0Cn7s4/6z21Dvu2L5pRkmwIe8SPFsaC1gqXJchtkG4F1Wz+AgAS6zlmsEsRvv2slvTVnl5JI5KPrQ0AHuAvW5K5SwwPjclXT6Bnuu1EoyPq+9NsnXxRUJ8XfxU5JrdqC1Z05cJk= 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 1652975947612866.0918917931149; Thu, 19 May 2022 08:59:07 -0700 (PDT) Received: from localhost ([::1]:54430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nriYM-00010D-KJ for importer2@patchew.org; Thu, 19 May 2022 11:59:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriW9-0007MS-6S for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriVx-000321-W7 for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:48 -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-279-htFgwIaWOuCyoXhhE4UeWg-1; Thu, 19 May 2022 11:56:35 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CBA26811E76 for ; Thu, 19 May 2022 15:56:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 132F9492C14; Thu, 19 May 2022 15:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652975797; 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=RqRl+ljAGvE6MiJ+r5v6CGsQkAGcUX56c8fJnhEImgQ=; b=UeIYKQNaUZMYchRrwRI7I4sKgWKqqL5FIS9w47/k5aXa9OEs2Y7C7CWjf34OiEQmchsRUt bB0/Vg6GHW0w3yFfkjEoBSQzfmHPlNybLbfacjYOURm1sD/tjllEhOKROJEl/JRlgW+VYr qDxKtVIDoopLoUOnIatyKSvjI+xZ/a0= X-MC-Unique: htFgwIaWOuCyoXhhE4UeWg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini Subject: [PATCH v3 2/3] ui: Switch "-display sdl" to use the QAPI parser Date: Thu, 19 May 2022 17:56:24 +0200 Message-Id: <20220519155625.1414365-3-thuth@redhat.com> In-Reply-To: <20220519155625.1414365-1-thuth@redhat.com> References: <20220519155625.1414365-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1652975948526100001 Content-Type: text/plain; charset="utf-8" The "-display sdl" option still uses a hand-crafted parser for its parameters since we didn't want to drag an interface we considered somewhat flawed into the QAPI schema. Since the flaws are gone now, it's time to QAPIfy. 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" that is used to specify the required modifier keys to escape from the mouse grabbing mode. Signed-off-by: Thomas Huth Reviewed-by: Markus Armbruster --- qapi/ui.json | 26 ++++++++++++++- include/sysemu/sysemu.h | 2 -- softmmu/globals.c | 2 -- softmmu/vl.c | 70 +---------------------------------------- ui/sdl2.c | 10 ++++++ 5 files changed, 36 insertions(+), 74 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 11a827d10f..413371d5e8 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1295,6 +1295,29 @@ '*swap-opt-cmd': 'bool' } } =20 +## +# @HotKeyMod: +# +# Set of modifier keys that need to be held for shortcut key actions. +# +# Since: 7.1 +## +{ 'enum' : 'HotKeyMod', + 'data' : [ 'lctrl-lalt', 'lshift-lctrl-lalt', 'rctrl' ] } + +## +# @DisplaySDL: +# +# SDL2 display options. +# +# @grab-mod: Modifier keys that should be pressed together with the +# "G" key to release the mouse grab. +# +# Since: 7.1 +## +{ 'struct' : 'DisplaySDL', + 'data' : { '*grab-mod' : 'HotKeyMod' } } + ## # @DisplayType: # @@ -1374,7 +1397,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 b4030acd74..812f66a31a 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 uint8_t *boot_splash_filedata; diff --git a/softmmu/globals.c b/softmmu/globals.c index 916bc12e2b..527edbefdd 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]; uint8_t *boot_splash_filedata; diff --git a/softmmu/vl.c b/softmmu/vl.c index 57ab9d5322..484e9d9921 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1056,75 +1056,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..8cb77416af 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,14 @@ 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 (o->u.sdl.grab_mod =3D=3D HOT_KEY_MOD_LSHIFT_LCTRL_LALT) { + alt_grab =3D true; + } else if (o->u.sdl.grab_mod =3D=3D HOT_KEY_MOD_RCTRL) { + ctrl_grab =3D true; + } + } + for (i =3D 0;; i++) { QemuConsole *con =3D qemu_console_lookup_by_index(i); if (!con) { --=20 2.27.0 From nobody Sun May 19 22:50:26 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=1652977985; cv=none; d=zohomail.com; s=zohoarc; b=FmgkbB/oqof7ZXVJqPNG0wHkBPl0q78yQnHgRqOXiTsbwXVj+qM8vFfRUGUSdkj522o79wRggNrJuvzMkZKL67ecib9PaSUNOcgXOFnF/rsBhzW1yyTC7o5TZPQV0NpZyf7ncjRs1rbbV9TfC6tP+9gegpT9i/ptV7wDlWN/LGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652977985; h=Content-Type: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=IovU1QTpZA81AIT0Gbs7eSE9rqZTJy4GUXf6wYRsIjc=; b=EsXYh5J4tXPbydFP1lfgDbjquOsnt38qwWGu/WeMHm005a4STIPAik+jAX3SH6EcpuzMlVZaP/rkXtT2TQJtm2NSgzTMV+HB7tFotDWElnsUHK+42DRd25n+OnyuE1bspE1EOgjJegopuVIkH0PRsUKyLYSyLGUFZjABIJ292qY= 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 1652977985176837.1194809766611; Thu, 19 May 2022 09:33:05 -0700 (PDT) Received: from localhost ([::1]:45456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrj5D-0001rb-Sg for importer2@patchew.org; Thu, 19 May 2022 12:33:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriW9-0007MB-Vp for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nriVz-00032G-Ax for qemu-devel@nongnu.org; Thu, 19 May 2022 11:56:48 -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-501--DZofsW4NTu_QCrfyG-KTQ-1; Thu, 19 May 2022 11:56:37 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9E65101A52C for ; Thu, 19 May 2022 15:56:36 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AA62492C14; Thu, 19 May 2022 15:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652975798; h=from:from: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; bh=IovU1QTpZA81AIT0Gbs7eSE9rqZTJy4GUXf6wYRsIjc=; b=eEZucDWQMe8RKQyVPsWmRWBlOkvTmh8eG1L2896SDu1TvsjoOeQdj7LyvLmSEoYbrs7BJC 8bTod0mKGt4yJeFbBVqVi83E9AiPT2dPdzLZMmtguQREb3z9MBa9WNCQNKjOFz3fTAPTCK E+9uTFaqnX74cSJpe6b4sJb64XDv4co= X-MC-Unique: -DZofsW4NTu_QCrfyG-KTQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Gerd Hoffmann Cc: Markus Armbruster , Eric Blake , Paolo Bonzini Subject: [PATCH v3 3/3] ui: Remove deprecated options "-sdl" and "-curses" Date: Thu, 19 May 2022 17:56:25 +0200 Message-Id: <20220519155625.1414365-4-thuth@redhat.com> In-Reply-To: <20220519155625.1414365-1-thuth@redhat.com> References: <20220519155625.1414365-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1652977988058100001 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). Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- 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 562a133f18..e19bcba242 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -81,16 +81,6 @@ the process listing. This is replaced by the new ``passw= ord-secret`` option which lets the password be securely provided on the command line using a ``secret`` object instance. =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 4c9e001c35..c7b9dadd5d 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -386,6 +386,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 484e9d9921..4c1e94b00e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2800,16 +2800,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; @@ -3176,15 +3166,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 726e437a97..60cf188da4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1981,9 +1981,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 @@ -2085,25 +2084,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