Bug 873341 - Keyboard input focus broken (mostly win key captured by both guest and client)
Summary: Keyboard input focus broken (mostly win key captured by both guest and client)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: mingw-virt-viewer
Version: 3.1.0
Hardware: Unspecified
OS: Windows
unspecified
unspecified
Target Milestone: ---
: 3.3.0
Assignee: Marc-Andre Lureau
QA Contact: Desktop QE
URL:
Whiteboard:
: 1001847 (view as bug list)
Depends On: 857389
Blocks: 973652
TreeView+ depends on / blocked
 
Reported: 2012-11-05 15:32 UTC by Uri Lublin
Modified: 2018-12-05 15:41 UTC (History)
10 users (show)

Fixed In Version: mingw-virt-viewer-0.5.6-6.el6_4
Doc Type: Bug Fix
Doc Text:
When the Win key was pressed outside of virt-viewer, it was captured by both client and guest. Now virt-viewer does not handle special keys with a global hook when the keyboard is not grabbed. As a result, the Win key is captured only by Windows or by virt-viewer, and not both.
Clone Of: 857389
: 973652 (view as bug list)
Environment:
Last Closed: 2014-01-21 14:44:54 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 466653 0 None None None Never
Red Hat Product Errata RHBA-2014:0034 0 normal SHIPPED_LIVE mingw-virt-viewer enhancement update 2014-01-21 19:41:37 UTC

Description Uri Lublin 2012-11-05 15:32:24 UTC
This bug should fix the problem for the case where remote-viewer window is not in-focus (cursor is located outside of remote-viewer window).

Bug 857389 is now fixed for the case where remote-viewer window is in-focus (cursor is located within remote-viewer window)

+++ This bug was initially created as a clone of Bug #857389 +++

Description of problem:

This might actually be two seperate bugs, but one of them appears at random, and they seem to be pretty closely related.

Connecting to a guest with cursor in client mode can result in keyboard focus behaving somewhat strangely: 
 -- win key captured both by client and guest
 -- (the random, barely reproducible) input redirected to guest even though virt-viewer doesn't appear to be focused (a different client side application should have the keyboard focus)

Version-Release number of selected component (if applicable):
mingw-virt-viewer 0.5.3

How reproducible:
Always (win key)


Steps to Reproduce:
1. Connect to a Windows 7 (or 8) guest (preferably with 2 monitors) with a windows 7 (or 8) client
2. Focus on a different application on clients side (don't have virt-viewer focused), move cursor out of the virt-viewer
3. alt+tab to virt-viewer (cursor still out of the window)
4. hit win key
  
Actual results:
Windows key gets grabbed both by client and guest. 

Expected results:
Win key is captured just by guest

Additional info:
If you're lucky you'll notice the other bug as well (client applications won't be receiving input)

Comment 1 David Blechter 2013-02-06 17:50:43 UTC
no pm ack for 3.2, revert devel ack to ?,

Comment 2 Marc-Andre Lureau 2013-04-02 15:54:13 UTC
spice-gtk doesn't take the keyboard grab when the pointer is not over the application.

iirc, this is to avoid to be trapped precisely when giving the focus with alt-tab, so that you can cycle again to other apps. The behaviour is the same on Linux.

So, if we take the grab, windows won't catch the Win key press, but you won't be able to alt-tab = move out of the client the same way you entered it.

Imho, no taking the grab is better than forcefully taking it whenever the client gets the focus (especially when the widget is embedded, for ex in virt-manager).

This was originally written this way by Gerd in the very early version of spice-gtk.

Apparently, gtk-vnc does something similar, only taking keyboard grab when entering the widget.

I don't see a major issue if the win key is received by both client and guest (when the keyboard is not grabbed & the pointer is not over the display)

Eventually, we can special-case on windows client, and filter out the Win key when not having the keyboard grab.

Comment 3 Marc-Andre Lureau 2013-04-02 16:16:42 UTC
RFC patch sent to the ML, does ok for me

http://lists.freedesktop.org/archives/spice-devel/2013-April/012944.html

Comment 9 Tomas Jamrisko 2013-09-26 15:57:32 UTC
The keyboard focus on windows clients is now completely strange.

I've been under the impression that hovering cursor over area should capture it, as it does on linux. It doesn't. Unless the window is "selected" it doesn't intercept any keys.

The worse part is, that alt-tab is no longer handled by guest (with windows 7 and 8 clients) and is instead always handled by client, regardless of focus. 

I'd say this needs further fixing and suggest moving it back to ASSIGNED

Comment 10 Marc-Andre Lureau 2013-09-26 16:06:21 UTC
(In reply to Tomas Jamrisko from comment #9)
> The keyboard focus on windows clients is now completely strange.
> 
> I've been under the impression that hovering cursor over area should capture
> it, as it does on linux. It doesn't. Unless the window is "selected" it
> doesn't intercept any keys.

alt-tab seems broken, probably not because of that fix.

win key isn't received by both guest and client, that was the point of this bug. Only by client when it has focus and mouse, which I think is the correct way.

> 
> The worse part is, that alt-tab is no longer handled by guest (with windows
> 7 and 8 clients) and is instead always handled by client, regardless of
> focus. 
> 
> I'd say this needs further fixing and suggest moving it back to ASSIGNED

I think alt-tab is a regression and should be a different bug instead.

Comment 11 Marc-Andre Lureau 2013-09-26 18:26:28 UTC
Fixed in, moving to POST:
http://lists.freedesktop.org/archives/spice-devel/2013-September/014694.html

Comment 13 Charlie 2013-11-28 01:26:10 UTC
This bug is currently attached to errata RHEA-2013:15512. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to 
minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 15 errata-xmlrpc 2014-01-21 14:44:54 UTC
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0034.html

Comment 16 Marc-Andre Lureau 2014-04-01 12:10:37 UTC
*** Bug 1001847 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.