Skip to content

Commit d46156f

Browse files
committed
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: <[email protected]> Reviewed-by: Gerd Hoffmann <[email protected]> Acked-by: Peter Krempa <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 8e8e844 commit d46156f

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

docs/about/deprecated.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ an underscore between "window" and "close").
138138
The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which
139139
should be used instead.
140140

141+
``-alt-grab`` and ``-display sdl,alt_grab=on`` (since 6.2)
142+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
143+
144+
Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
145+
146+
``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (since 6.2)
147+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
148+
149+
Use ``-display sdl,grab-mod=rctrl`` instead.
150+
141151

142152
Plugin argument passing through ``arg=<string>`` (since 6.1)
143153
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

qemu-options.hx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,9 +1884,11 @@ SRST
18841884
the mouse grabbing in conjunction with the "g" key. `<mods>` can be
18851885
either `lshift-lctrl-lalt` or `rctrl`.
18861886

1887-
``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing
1887+
``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing.
1888+
This parameter is deprecated - use ``grab-mod`` instead.
18881889

1889-
``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing
1890+
``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing.
1891+
This parameter is deprecated - use ``grab-mod`` instead.
18901892

18911893
``gl=on|off|core|es`` : Use OpenGL for displaying
18921894

@@ -1971,7 +1973,8 @@ SRST
19711973
``-alt-grab``
19721974
Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
19731975
this also affects the special keys (for fullscreen, monitor-mode
1974-
switching, etc).
1976+
switching, etc). This option is deprecated - please use
1977+
``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
19751978
ERST
19761979

19771980
DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
@@ -1981,7 +1984,8 @@ SRST
19811984
``-ctrl-grab``
19821985
Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
19831986
also affects the special keys (for fullscreen, monitor-mode
1984-
switching, etc).
1987+
switching, etc). This option is deprecated - please use
1988+
``-display sdl,grab-mod=rctrl`` instead.
19851989
ERST
19861990

19871991
DEF("no-quit", 0, QEMU_OPTION_no_quit,

softmmu/vl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ static void parse_display(const char *p)
10431043
} else {
10441044
goto invalid_sdl_args;
10451045
}
1046+
warn_report("alt_grab is deprecated, use grab-mod instead.");
10461047
} else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
10471048
opts = nextopt;
10481049
if (strstart(opts, "on", &nextopt)) {
@@ -1052,6 +1053,7 @@ static void parse_display(const char *p)
10521053
} else {
10531054
goto invalid_sdl_args;
10541055
}
1056+
warn_report("ctrl_grab is deprecated, use grab-mod instead.");
10551057
} else if (strstart(opts, ",window_close=", &nextopt) ||
10561058
strstart(opts, ",window-close=", &nextopt)) {
10571059
if (strstart(opts, ",window_close=", NULL)) {
@@ -3245,9 +3247,13 @@ void qemu_init(int argc, char **argv, char **envp)
32453247
break;
32463248
case QEMU_OPTION_alt_grab:
32473249
alt_grab = 1;
3250+
warn_report("-alt-grab is deprecated, please use "
3251+
"-display sdl,grab-mod=lshift-lctrl-lalt instead.");
32483252
break;
32493253
case QEMU_OPTION_ctrl_grab:
32503254
ctrl_grab = 1;
3255+
warn_report("-ctrl-grab is deprecated, please use "
3256+
"-display sdl,grab-mod=rctrl instead.");
32513257
break;
32523258
case QEMU_OPTION_no_quit:
32533259
dpy.has_window_close = true;

0 commit comments

Comments
 (0)