Bug 1791261
| Summary: | Zoom hot keys labels are missing | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Radek Duda <rduda> | ||||||
| Component: | virt-viewer | Assignee: | Uri Lublin <uril> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 8.2 | CC: | berrange, jjanku, juzhou, mtessun, spice-qe-bugs, tyan, tzheng, uril, victortoso, xiaodwan | ||||||
| Target Milestone: | rc | Keywords: | Triaged | ||||||
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | virt-viewer-9.0-7.el8 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 1791263 (view as bug list) | Environment: | |||||||
| Last Closed: | 2021-05-18 15:53:32 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: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 1791263 | ||||||||
| Attachments: |
|
||||||||
Hi Radek Duda, I can't reproduce your issue with package version: virt-viewer-7.0-9.el8.x86_64 Steps: 1. Prepare a running guest. 2. Then connect the guest by virt-viewer or remote-viewer: $ virt-viewer -c qemu:///system $guest or $ remote-viewer spice://$host:$port Then click: View->Zoom, I can find hot key labels: 'Zoom In' Ctrl++ 'Zoom Out' Ctrl+- 'Normal Size' Ctrl+0 And it works well by clicking "Zoom In" and by using hotkey "Ctrl++". Please help check your os again, is it the latest one, thanks. BR, juzhou. Hi zhoujunqin, I tried with latest virt-viewer-7.0-9.el8.x86_64 and I can reproduce this. Surprisingly I can reproduce this only with RHV VMs - not with my local libvirt VMs (established using virt-manager) reproduced with rhv-4.4.0-0.14.master.el7 and also with rhv-4.3.8.2-0.1.master.el7 I really do not know what component to blame now. Created attachment 1652672 [details]
Screenshot
No hot-key labels when connected to RHV VM
Created attachment 1652675 [details]
Screenshot
No hot-key labels when connected to RHV VM
(In reply to Radek Duda from comment #2) > Hi zhoujunqin, > I tried with latest virt-viewer-7.0-9.el8.x86_64 and I can reproduce this. > Surprisingly I can reproduce this only with RHV VMs - not with my local > libvirt VMs (established using virt-manager) > > reproduced with > rhv-4.4.0-0.14.master.el7 > and also with > rhv-4.3.8.2-0.1.master.el7 > > I really do not know what component to blame now. Hi Radek Duda, Thanks for your quick reply. Yes, I can also reproduce this issue when connect to RHV vm, thanks. But I have tried that the hotkeys don't work. @Victor, could you help have a look of this issue, thanks. According to my testing - hot keys for zooming are fully functional only labels are missing Happens also when connecting to VMs and changing the hotkeys on command line: remote-viewer --hotkeys=toggle-fullscreen=F spice://host:port (In reply to Uri Lublin from comment #9) > Happens also when connecting to VMs and changing the hotkeys > on command line: > remote-viewer --hotkeys=toggle-fullscreen=F spice://host:port That's seems to be on purpose: only hotkeys that are specified by the command line are used, and default ones are being removed. Done by first calling virt_viewer_app_clear_hotkeys and later setting each key separately. Hi Uri, I tried to find out if any key in console.vv file causes zoom hot key labels to disappear. But if I connect using minimalistic `console.vv` file: [virt-viewer] type=spice host=localhost port=5900 hot key labels disappear. If I connect using cmd-line: remote-viewer spice://localhost:5900 zoom hot key labels are on the place. The behavior reported by this bug is by design. Any hotkey that is not mentioned is being cleared. A user that wants to keep default hotkeys must mention them specifically in the vv-file/command-line. Currently it's not possible for zoom hotkeys. I think there are several options to fix this bug: 1. Not clear zoom hotkeys. No code changes those hotkeys anyway. The drawback is that it makes zoom hotkeys special (but they already are). Also, a user can not disable these hotkeys. 2. Not clear hotkeys at all, just update the hotkeys that are mentioned. The drawback is that it changes the behavior as it was for years. Also, a user can not disable a hotkey (we can add a special keyword for that) 3. Add code to enable changing zoom hotkeys. This means that those zoom hotkeys must always be set in the vv-file. 4. Not clear hotkeys if the vv-file does not change any hotkey. This only solves a simple case such as in comment #12, so not a real solution. I'm going to start with option 1. (In reply to Uri Lublin from comment #13) > The behavior reported by this bug is by design. > Any hotkey that is not mentioned is being cleared. With exception of 'Quit' - 'Shift+Ctrl+Q' > A user that wants to keep default hotkeys must mention them > specifically in the vv-file/command-line. > > Currently it's not possible for zoom hotkeys. > > I think there are several options to fix this bug: > 1. Not clear zoom hotkeys. > No code changes those hotkeys anyway. > The drawback is that it makes zoom hotkeys special (but they already are). > Also, a user can not disable these hotkeys. > > 2. Not clear hotkeys at all, just update the hotkeys that are mentioned. > The drawback is that it changes the behavior as it was for years. > Also, a user can not disable a hotkey (we can add a special keyword for > that) > > 3. Add code to enable changing zoom hotkeys. > This means that those zoom hotkeys must always be set in the vv-file. > > 4. Not clear hotkeys if the vv-file does not change any hotkey. > This only solves a simple case such as in comment #12, so not > a real solution. > > > I'm going to start with option 1. I am not sure if you understand the bug. Zoom hot keys are working whether I connect with vv-file or not. If I press Ctrl++/Ctrl+-/Ctrl+0 it works ok in both cases. Only hotkey labels in application menu are missing if I connect using vv-file or pass hotkey cmd-line option (as in comment #9). > If I press Ctrl++/Ctrl+-/Ctrl+0 it works ok in both cases.
Hi Radek, are you using the +- keys on the numpad? If so, does the zoom functionality still work when pressing the regular +- keys?
If I connect using simplified vv-file: [virt-viewer] type=spice host=localhost port=5900 only +/-/0 keys from numpad works (and no hot key labels in remote-viewer menu). If I connect like this: remote-viewer spice://localhost:5900 both regular and numpad keys are working to zoom (and hot key labels are present in remote-viewer menu) (In reply to Radek Duda from comment #16) > If I connect using simplified vv-file: > [virt-viewer] > type=spice > host=localhost > port=5900 > > only +/-/0 keys from numpad works (and no hot key labels in remote-viewer > menu). > > If I connect like this: > remote-viewer spice://localhost:5900 > both regular and numpad keys are working to zoom (and hot key labels are > present in remote-viewer menu) Thanks for the info. I've just submitted https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/45 With this change, the zoom hotkeys should only work when the label is visible in the menu. Could you please test it? Concerning the labels: if you use vv file or specify any hotkey using the --hotkeys option, the zoom hotkeys should be disabled; the user cannot set a different zoom hotkey. Now I think that this is a bit weird and could be improved, but this bug itself should imo be fixed by unifying the behaviour of the normal and the keypad zoom hotkeys. Hi Jakub, this is not a bug report of working zoom hotkeys from numpad when they should not work. This is the bug report about missing zoom hotkey labels and consequently non working zoom hot keys when connected via vv-file (or passing any non-relevant --hotkey option). From the user perspective, I don't see a point why zoom hotkeys are not working when connected via vv-file (example of which is in comment #16). I think we should open a RFE: "unify the behaviour of normal and keypad zoom hotkeys" for your patch https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/45 Hi, I'm not sure whether the behaviour with vv-file and hotkeys is described somewhere, so I'll focus on the --hotkeys option: In the manual for virt-viewer and the --hotkeys option, you find the following: "Note that hotkeys for which no binding is given are disabled. Although the hotkeys specified here are handled by the client, it is still possible to send these key combinations to the guest via a menu item." The fact, that these hotkeys are disabled, is manifested by hiding the key binding labels in the menu. The confusion comes from the situation that keypad hotkeys still work, when they should be disabled and the label is missing, I think. So to me, this is directly related to this bug. > This is the bug report about missing zoom hotkey labels and consequently non working zoom hot keys when connected via vv-file (or passing any non-relevant --hotkey option). > From the user perspective, I don't see a point why zoom hotkeys are not working when connected via vv-file I agree with you on that. But then I don't see why this bug is marked as regression. The labels disappear by design and the manual explicitly says what happens if you use the --hotkey option. Some suggestions to change this bug report: 1. "RFE: allow the user to customize zoom hotkeys" 2. "RFE: don't disable all hotkeys when no hotkey is customized in the vv file" What do you think about that? > I think we should open a RFE: "unify the behaviour of normal and keypad zoom hotkeys" for your patch https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/45 It was approved and merged by Daniel Berrangé today, so that's probably unnecessary. Hi Jakub, I think you do not see full impact of this bug and your patch. I understand it is important to unify behaviour from numpad and normal hotkeys, but by your patch there will be no hotkey possible for zooming whatsoever for connections to VMs from Red Hat Virtualization Mangader since there is always some hotkey option sent to VM (or something like that), even thou no hotkey is specified in vv-file and thus zoom hotkeys are removed. You can not manually pass zoom hotkey option since only toggle-fullscreen, release-cursor, secure-attention, smartcard-insert and smartcard-remove are possible keys to pass (virt-viewer man pages). Btw I wonder 'Quit' hotkey is preserved (Shift+Ctrl+Q) ... why? Now when I see keypad zoom hotkey behaviour was different from normal zoom hotkey I think the most convenient would be number 1. solution in Uri's list (comment #13). What do you think Uri? (In reply to Radek Duda from comment #20) > Hi Jakub, > I think you do not see full impact of this bug and your patch. I understand > it is important to unify behaviour from numpad and normal hotkeys, but by > your patch there will be no hotkey possible for zooming whatsoever for > connections to VMs from Red Hat Virtualization Mangader since there is > always some hotkey option sent to VM (or something like that), even thou no > hotkey is specified in vv-file and thus zoom hotkeys are removed. You can > not manually pass zoom hotkey option since only toggle-fullscreen, > release-cursor, secure-attention, smartcard-insert and smartcard-remove are > possible keys to pass (virt-viewer man pages). Btw I wonder 'Quit' hotkey is > preserved (Shift+Ctrl+Q) ... why? > > Now when I see keypad zoom hotkey behaviour was different from normal zoom > hotkey I think the most convenient would be number 1. solution in Uri's list > (comment #13). What do you think Uri? Jakub's patch makes zoom hotkeys consistent for both keyboard and numpad. Also, it makes the zoom labels consistent with zoom hotkeys being enabled/disabled. So it fixes this specific bug about mismatch between hotkeys and labels. I did implement option number 1 above, but as mentioned the drawback is that users can't disable it. https://gitlab.com/uril/virt-viewer/-/commit/9239c3ebe77c3b0cf8e2298c63addaeaa65e1a97 I also implemented option number 3, which makes zoom hotkeys similar to other hotkeys. https://gitlab.com/uril/virt-viewer/-/commits/hotkeys_enable_changing_zoom I'm quite against the option 1, not being able to disable it seems like a major drawback. I rarely use the virt-viewer zoom options, on the other hand Ctrl++/Ctrl+- are quite universal, they can be useful in many applications in the guest (browser, file explorer, image viewer etc.). Option 3 seems much more reasonable to me, it gives the user more control. Patches to fix this bug: https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/45 https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/49 (In reply to Uri Lublin from comment #23) And https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/50 I can reproduce this issue with
virt-viewer-9.0-5.el8.x86_64
Then try to verify this bug with latest build:
virt-viewer-9.0-7.el8.x86_64
Steps:
1. Man page of virt-viewer and remote-viewer have updated, finding "zoom-in, zoom-out, zoom-reset" are added to the valid hotkeys actions.
$ man virt-viewer
...
-H HOTKEYS, --hotkeys HOTKEYS
Set global hotkey bindings. By default, keyboard shortcuts only work when the guest display widget does
not have focus. Any actions specified in HOTKEYS will be effective even when the guest display widget
has input focus. The format for HOTKEYS is <action1>=<key1>[+<key2>][,<action2>=<key3>[+<key4>]]. Key-
names are case-insensitive. Valid actions are: toggle-fullscreen, release-cursor, zoom-in, zoom-out,
zoom-reset, secure-attention, smartcard-insert and smartcard-remove.
...
$ man remote-viewer
...
-H HOTKEYS, --hotkeys HOTKEYS
Set global hotkey bindings. By default, keyboard shortcuts only work when the guest display widget does
not have focus. Any actions specified in HOTKEYS will be effective even when the guest display widget
has input focus. The format for HOTKEYS is <action1>=<key1>[+<key2>][,<action2>=<key3>[+<key4>]]. Key-
names are case-insensitive. Valid actions are: toggle-fullscreen, release-cursor, zoom-in, zoom-out,
zoom-reset, secure-attention, smartcard-insert and smartcard-remove.
...
"zoom-in" (hotkey string)
Key binding for zooming in and enlarging client window size. (see HOTKEY for description of expected
string)
"zoom-out" (hotkey string)
Key binding for zooming out and reducing client window size. (see HOTKEY for description of expected
string)
"zoom-reset" (hotkey string)
Key binding for reseting zoom and client window size. (see HOTKEY for description of expected string)
...
2. Test hotkeys
2.1 Test with local libvirt VMs (established using virt-manager)
2.1.1 Prepare a running guest.
2.1.2 Then connect the guest by virt-viewer or remote-viewer with setting hotkeys.
$ virt-viewer -c qemu:///system spice --hotkeys=zoom-in=shift+f2,zoom-out=shift+f3,zoom-reset=shift+f4
or
$ remote-viewer spice://127.0.0.1:5900 --hotkeys=z
Then click: View->Zoom, I can find hot key labels:
'Zoom In' Shift+F2
'Zoom Out' Shift+F3
'Normal Size' Shift+F4
And such above hotkeys can be seen under 'Send Key' toolbar - Shift+F4/Shift+F3/Shift+F2
Test result: All the hotkeys Shift+F4/Shift+F3/Shift+F2 work well.
2.1.3 Re-connect to the guest by virt-viewer or remote-viewer without setting hotkeys.
$ virt-viewer -c qemu:///system spice
or
$ remote-viewer spice://127.0.0.1:5900
Then click: View->Zoom, I can find hot key labels are as follows:
'Zoom In' Ctrl++
'Zoom Out' Ctrl+-
'Normal Size' Ctrl+0
Test result: Without setting hotkeys, zoom actions using "normal" hotkeys Ctrl++/Ctrl+- and working well.
2.2 Test with RHV VMs.
Red Hat Virtualization Manager Web Administration
Software Version:4.4.4.6-0.1.el8ev
2.2.1 Download a vm's console.vv file from rhv and open it directly.
$ remote-viewer console.vv
Test result: No zoom hot keys labels displays.
2.2.2 Download a vm's console.vv file from rhv again and add following content to the console.vv file.
zoom-in=shift+f2
zoom-out=shift+f3
zoom-reset=shift+f4
$ cat console.vv
[virt-viewer]
type=spice
...
# Password is valid for 120 seconds.
delete-this-file=1
fullscreen=0
title=clone-juzhou:%d
toggle-fullscreen=shift+f11
release-cursor=shift+f12
secure-attention=ctrl+alt+end
zoom-in=shift+f2
zoom-out=shift+f3
zoom-reset=shift+f4
tls-port=5903
...
2.2.3 Open the console.vv file by remote-viewer.
$ remote-viewer console.vv
Then click: View->Zoom, I can find hot key labels:
'Zoom In' Shift+F2
'Zoom Out' Shift+F3
'Normal Size' Shift+F4
And such above hotkeys can be seen under 'Send Key' toolbar - Shift+F4/Shift+F3/Shift+F2
Test result: All the hotkeys Shift+F4/Shift+F3/Shift+F2 work well.
I move this bug from ON_QA to VERIFIED Status based on above testing, thanks.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt-viewer bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:1876 |
Description of problem: In virt-viewer there are not hot key labels in View -> Zoom -> {Zoom {in,out}, Normal size} Version-Release number of selected component (if applicable): virt-viewer-7.0-9.el8.x86_64 How reproducible: always Steps to Reproduce: 1.Open remote-viewer by connectin to VM and got to Application menu -> View -> Zoom 2. See hot key labels are missing Actual results: Hot key labels are missing Expected results: User can find hot key labels: 'Zoom In' Ctrl++ 'Zoom Out' Ctrl+- 'Normal Size' Ctrl+0 or something like that. Additional info: