瀏覽代碼

softmmu/vl: Deprecate the old grab options

The alt_grab and ctrl_grab parameter of the -display sdl option prevent
the QAPIfication of the "sdl" part of the -display option, so we should
eventually remove them. And since this feature is also rather niche anyway,
we should not clutter the top-level option list with these, so let's
also deprecate the "-alt-grab" and the "-ctrl-grab" options while we're
at it.

Once the deprecation period of "alt_grab" and "ctrl_grab" is over, we
then can finally switch the -display sdl option to use QAPI internally,
too.

Message-Id: <20210825092023.81396-3-thuth@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Thomas Huth 4 年之前
父節點
當前提交
d46156fdcc
共有 3 個文件被更改,包括 24 次插入4 次删除
  1. 10 0
      docs/about/deprecated.rst
  2. 8 4
      qemu-options.hx
  3. 6 0
      softmmu/vl.c

+ 10 - 0
docs/about/deprecated.rst

@@ -138,6 +138,16 @@ an underscore between "window" and "close").
 The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which
 The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which
 should be used instead.
 should be used instead.
 
 
+``-alt-grab`` and ``-display sdl,alt_grab=on`` (since 6.2)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
+
+``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (since 6.2)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-display sdl,grab-mod=rctrl`` instead.
+
 
 
 Plugin argument passing through ``arg=<string>`` (since 6.1)
 Plugin argument passing through ``arg=<string>`` (since 6.1)
 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

+ 8 - 4
qemu-options.hx

@@ -1884,9 +1884,11 @@ SRST
         the mouse grabbing in conjunction with the "g" key. `<mods>` can be
         the mouse grabbing in conjunction with the "g" key. `<mods>` can be
         either `lshift-lctrl-lalt` or `rctrl`.
         either `lshift-lctrl-lalt` or `rctrl`.
 
 
-        ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing
+        ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing.
+        This parameter is deprecated - use ``grab-mod`` instead.
 
 
-        ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing
+        ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing.
+        This parameter is deprecated - use ``grab-mod`` instead.
 
 
         ``gl=on|off|core|es`` : Use OpenGL for displaying
         ``gl=on|off|core|es`` : Use OpenGL for displaying
 
 
@@ -1971,7 +1973,8 @@ SRST
 ``-alt-grab``
 ``-alt-grab``
     Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
     Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
     this also affects the special keys (for fullscreen, monitor-mode
     this also affects the special keys (for fullscreen, monitor-mode
-    switching, etc).
+    switching, etc). This option is deprecated - please use
+    ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
 ERST
 ERST
 
 
 DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
 DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
@@ -1981,7 +1984,8 @@ SRST
 ``-ctrl-grab``
 ``-ctrl-grab``
     Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
     Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
     also affects the special keys (for fullscreen, monitor-mode
     also affects the special keys (for fullscreen, monitor-mode
-    switching, etc).
+    switching, etc). This option is deprecated - please use
+    ``-display sdl,grab-mod=rctrl`` instead.
 ERST
 ERST
 
 
 DEF("no-quit", 0, QEMU_OPTION_no_quit,
 DEF("no-quit", 0, QEMU_OPTION_no_quit,

+ 6 - 0
softmmu/vl.c

@@ -1043,6 +1043,7 @@ static void parse_display(const char *p)
                 } else {
                 } else {
                     goto invalid_sdl_args;
                     goto invalid_sdl_args;
                 }
                 }
+                warn_report("alt_grab is deprecated, use grab-mod instead.");
             } else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
             } else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
                 opts = nextopt;
                 opts = nextopt;
                 if (strstart(opts, "on", &nextopt)) {
                 if (strstart(opts, "on", &nextopt)) {
@@ -1052,6 +1053,7 @@ static void parse_display(const char *p)
                 } else {
                 } else {
                     goto invalid_sdl_args;
                     goto invalid_sdl_args;
                 }
                 }
+                warn_report("ctrl_grab is deprecated, use grab-mod instead.");
             } else if (strstart(opts, ",window_close=", &nextopt) ||
             } else if (strstart(opts, ",window_close=", &nextopt) ||
                        strstart(opts, ",window-close=", &nextopt)) {
                        strstart(opts, ",window-close=", &nextopt)) {
                 if (strstart(opts, ",window_close=", NULL)) {
                 if (strstart(opts, ",window_close=", NULL)) {
@@ -3245,9 +3247,13 @@ void qemu_init(int argc, char **argv, char **envp)
                 break;
                 break;
             case QEMU_OPTION_alt_grab:
             case QEMU_OPTION_alt_grab:
                 alt_grab = 1;
                 alt_grab = 1;
+                warn_report("-alt-grab is deprecated, please use "
+                            "-display sdl,grab-mod=lshift-lctrl-lalt instead.");
                 break;
                 break;
             case QEMU_OPTION_ctrl_grab:
             case QEMU_OPTION_ctrl_grab:
                 ctrl_grab = 1;
                 ctrl_grab = 1;
+                warn_report("-ctrl-grab is deprecated, please use "
+                            "-display sdl,grab-mod=rctrl instead.");
                 break;
                 break;
             case QEMU_OPTION_no_quit:
             case QEMU_OPTION_no_quit:
                 dpy.has_window_close = true;
                 dpy.has_window_close = true;