On Mon, Apr 17, 2023 at 11:02:00PM +0000, Singh, Satyeshwar wrote: > In a multi-seat scenario where multiple keyboards and mice are connected > to the host but some are dedicated for the guests only (through pass > through mode) and some are only for the host, there is a strong use case > where a customer does not want a HID device connected to the host to be > able to control the guest. > In such a scenario, neither should we bind any input events to Qemu UI, > nor should we show menu options like "Grab on Hover" or "Grab Input". > This patch adds a GTK command line option called "no-input". > It can be set like this: > gtk,no-input=off/on > > If set to off or completely left out, it will default to normal > operation where host HID devices can control the guests. However, if > turned on, then host HID devices will not be able to control the guest > windows. > > Signed-off-by: Satyeshwar Singh <satyeshwar.si...@intel.com> > Cc: Dongwon Kim <dongwon....@intel.com> > Cc: Vivek Kasireddy <vivek.kasire...@intel.com> > Cc: Gerd Hoffmann <kra...@redhat.com> > Cc: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > qapi/ui.json | 5 ++++- > qemu-options.hx | 4 +++- > ui/gtk.c | 39 +++++++++++++++++++++++++++------------ > 3 files changed, 34 insertions(+), 14 deletions(-) > > diff --git a/qapi/ui.json b/qapi/ui.json > index 98322342f7..cd3ef4678e 100644 > --- a/qapi/ui.json > +++ b/qapi/ui.json > @@ -1214,6 +1214,8 @@ > # Since 7.1 > # @show-menubar: Display the main window menubar. Defaults to "on". > # Since 8.0 > +# @no-input: Don't let host's HID devices control the guest. Defaults to > "off". > +# Since 8.0 > # > # Since: 2.12 > ## > @@ -1221,7 +1223,8 @@ > 'data' : { '*grab-on-hover' : 'bool', > '*zoom-to-fit' : 'bool', > '*show-tabs' : 'bool', > - '*show-menubar' : 'bool' } } > + '*show-menubar' : 'bool', > + '*no-input' : 'bool' } }
We don't generally like negative boolean options. IOW, we would prefer '*input': 'bool' with the default being 'on' if omitted, of course. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|