Bug 1824480

Summary: The menubar of the VM window / above the SPICE display is not accessible using the keyboard
Product: [Community] Virtualization Tools Reporter: Shlomi Fish <shlomif>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-09 16:11:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shlomi Fish 2020-04-16 09:52:47 UTC
Description of problem:

The menubar of the VM window / above the SPICE display is not accessible using the keyboard.

Pressing Alt+F / etc. after ctrl+alt when the VM is running does nothing.

Here is a log from OFTC-#virt with some details (I am "rindolf"):

```
<rindolf>	Hi all! I'm using virt-manager on fedora 32 x64 beta. I know I can use leftctrl+leftalt to release the keyboard/mouse focus, but how can I access the vmwindow's menubar using the keyboard? So far I tried: 1. ddg. 2. grepping the pygtk sources. 3. google - no success.
<Alexey>	Hi. Do you mean you're having issues with accessing menubar above SPICE area?
<rindolf>	Alexey: what is SPICE?
<Alexey>	rindolf: It's remote desktop protocol used for showing display of guest VM. virt-manager has built-in SPICE client
<Alexey>	https://www.virt-manager.org/wp-content/uploads/2014/01/console.png
<rindolf>	Alexey: yes, i want the «[File] [Virtual Machine] [View] [Send Key]» gtk+ menubar in the vm window
<Alexey>	rindolf: Have you tried pressing ALT to achieve this? E.g. ALT-F gets [File] opened
<rindolf>	Alexey: i have - it didn't work
<rindolf>	Alexey: tried again - still didn't work
<Alexey>	rindolf: Actually I have this behavior too when using SPICE. When VM is off ALT-F works well. It's probably bug. Since I don't use embedded SPICE client I haven't faced this problem yet
<rindolf>	Alexey: what do you use instead?
<Alexey>	rindolf: Personally I use GPU passthrough with software keyboard-mouse switch. If it isn't viable option for you, you might like using Remmina as a SPICE client instead of embedded in virt-manager one
<rindolf>	Alexey: i see: https://en.wikipedia.org/wiki/Remmina
<rindolf>	Alexey: oh, crud! It is a gnome 3-like app - i hate those :(
```
Version-Release number of selected component (if applicable):

Fedora 32.

How reproducible:

Comment 1 Cole Robinson 2020-09-09 16:11:16 UTC
Yeah something isn't right here, thanks for the report. It should be fixed upstream now:

commit aafb874c8586f55b5161cd4287801a41fa1fe887 (HEAD -> master, work)
Author: Cole Robinson <crobinso>
Date:   Wed Sep 9 09:33:58 2020 -0400

    viewers: Enable window modifiers when viewer doesn't have keyboard



The behavior though is that you need to click outside the viewer, like on the window title bar, before accelerators will go to that window. Otherwise they go to the VM. That's the same behavior as virt-viewer. If you always want accelerators to go to the virt-manager window you can set the SPICE_NOGRAB environment variable, but itll only take effect with virt-manager after that commit

Comment 2 Shlomi Fish 2020-09-10 08:53:57 UTC
Hi Cole!

Thanks for implementing the fix.

(In reply to Cole Robinson from comment #1)
> Yeah something isn't right here, thanks for the report. It should be fixed
> upstream now:
> 
> commit aafb874c8586f55b5161cd4287801a41fa1fe887 (HEAD -> master, work)
> Author: Cole Robinson <crobinso>
> Date:   Wed Sep 9 09:33:58 2020 -0400
> 
>     viewers: Enable window modifiers when viewer doesn't have keyboard
> 
> 
> 
> The behavior though is that you need to click outside the viewer, like on
> the window title bar, before accelerators will go to that window. Otherwise
> they go to the VM. 

I have a question: instead of clicking outside the viewer using the mouse - can I use the Ctrl+Alt keyboard combination? I have problems using the mouse due to a disability and being able to perform it using the keyboard alone is good accessibility and usability.

I'm awaiting for your reply.

Regards,

-- Shlomi

> That's the same behavior as virt-viewer. If you always
> want accelerators to go to the virt-manager window you can set the
> SPICE_NOGRAB environment variable, but itll only take effect with
> virt-manager after that commit

Comment 3 Cole Robinson 2020-09-10 13:47:51 UTC
> 
> I have a question: instead of clicking outside the viewer using the mouse -
> can I use the Ctrl+Alt keyboard combination? I have problems using the mouse
> due to a disability and being able to perform it using the keyboard alone is
> good accessibility and usability.

This works as you describe after the change above. Sorry I forgot to mention
that

Comment 4 Shlomi Fish 2020-11-02 14:16:23 UTC
(In reply to Cole Robinson from comment #3)
> > 
> > I have a question: instead of clicking outside the viewer using the mouse -
> > can I use the Ctrl+Alt keyboard combination? I have problems using the mouse
> > due to a disability and being able to perform it using the keyboard alone is
> > good accessibility and usability.
> 
> This works as you describe after the change above. Sorry I forgot to mention
> that

Thanks for your help. Just for the record, it seems to work here much better in fedora 33 (which I tested starting from the beta). Thanks!