Re: VirtualBox and keyboard grabs



One option would be for GNOME to be able to only take a pointer grab
if the keyboard is taken when dragging windows. It might be confusing
or dangerous to the user though -- key presses would go to the guest
when interacting with windows on the host.

If you don't select for KeyPressMask / KeyReleaseMask, and instead
have it on your window mask, and have owner_events in the grab, then I
believe that might make things work when mutter makes these changes.
When another window takes key focus through dragging, key events will
be dropped. The downside is that the application wouldn't receive
events while not focused. If that isn't a problem, this might just be
an option for you.

I don't think there's any greater option here. If you have a grab, you
have exclusive control of the keyboard device, and mutter can't say
"ha, jinx!" and steal it back. There have been proposed solutions for
this problem ( https://fedoraproject.org/wiki/Features/Grab_override )
but I doubt we will see them being done any time soon. I think Peter
even abandoned the Grab Override concept, actually.

On Mon, Nov 30, 2015 at 6:50 AM, Michael Thayer
<michael thayer oracle com> wrote:
Hello All,

This is a question related to running VirtualBox on a host system with GNOME
Shell (it actually applies to Metacity and Unity too).  Basically our
problem is that when we do a full keyboard grab, it is not possible to drag
windows with GNOME Shell  (I haven't checked very recently, but I don't
think it has changed in the meantime).  I do understand why that happens.
We have worked around this since time immemorial by using XGrabKey() instead
of XGrabKeyboard() except when we are in full-screen mode.  I was wondering
though, if anyone had a better idea as to how to solve it.  Remmina does it
by dropping grabs when the mouse pointer leaves its window, which we did not
really consider an improvement on what we have now, since it is potentially
confusing for non-focus-follows-mouse sorts of people.

Any thoughts welcome, and if no one has any good solution thanks anyway.

Regards,

Michael
--
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael thayer oracle com

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der
Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher
_______________________________________________
gnome-shell-list mailing list
gnome-shell-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list



-- 
  Jasper


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]