After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743319 - Hint user about keyboard ungrab/grab
Hint user about keyboard ungrab/grab
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: display
3.15.x
Other Linux
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-21 22:28 UTC by Zeeshan Ali
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use "keyboard-grab" signal to detect the change of the grab (2.32 KB, patch)
2015-01-22 13:50 UTC, Pavel Grunt
reviewed Details | Review
Give hint about keyboard ungrab / grab (3.16 KB, patch)
2015-01-22 15:39 UTC, Pavel Grunt
needs-work Details | Review
display: add keyboard grabbed property (1.49 KB, patch)
2015-02-05 10:51 UTC, Pavel Grunt
accepted-commit_now Details | Review
display-page: Hint about keyboard grab (2.90 KB, patch)
2015-02-05 10:52 UTC, Pavel Grunt
needs-work Details | Review
display-page: Add keyboard grabbed property (818 bytes, patch)
2015-02-10 09:10 UTC, Pavel Grunt
accepted-commit_now Details | Review
display-page: Rename grabbed to mouse_grabbed (1.03 KB, patch)
2015-02-10 09:11 UTC, Pavel Grunt
accepted-commit_now Details | Review
display-page: Hint about keyboard grab (2.09 KB, patch)
2015-02-10 09:15 UTC, Pavel Grunt
none Details | Review
display-page: Hint about keyboard grab (1.80 KB, patch)
2015-02-11 07:57 UTC, Pavel Grunt
reviewed Details | Review
display-page: Hint about keyboard grab (2.02 KB, patch)
2015-02-11 15:32 UTC, Pavel Grunt
none Details | Review
display-page: Improved hint for upgrabbing (783 bytes, patch)
2015-02-12 17:20 UTC, Zeeshan Ali
committed Details | Review
display-page: Rename grabbed to mouse_grabbed (2.37 KB, patch)
2015-02-12 17:20 UTC, Zeeshan Ali
needs-work Details | Review
display: Add keyboard_grabbed property (1.51 KB, patch)
2015-02-12 17:21 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display-page: Add keyboard_grabbed property (810 bytes, patch)
2015-02-12 17:21 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display-page: Hint about keyboard grab (2.11 KB, patch)
2015-02-12 17:21 UTC, Zeeshan Ali
needs-work Details | Review
display-page: Rename grabbed to mouse_grabbed (2.35 KB, patch)
2015-02-13 11:46 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display: Add keyboard_grabbed property (1.56 KB, patch)
2015-02-13 11:46 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display-page: Add keyboard_grabbed property (866 bytes, patch)
2015-02-13 11:47 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display-page: Hint about keyboard grab (2.15 KB, patch)
2015-02-13 11:47 UTC, Zeeshan Ali
needs-work Details | Review
display-page: Hint about keyboard grab (2.26 KB, patch)
2015-02-13 16:41 UTC, Zeeshan Ali
accepted-commit_now Details | Review
display-page: More specific names for grab props (3.04 KB, patch)
2015-02-13 17:23 UTC, Zeeshan Ali
committed Details | Review
display: Add keyboard_grabbed property (1.56 KB, patch)
2015-02-13 17:23 UTC, Zeeshan Ali
committed Details | Review
display-page: Add keyboard_grabbed property (864 bytes, patch)
2015-02-13 17:24 UTC, Zeeshan Ali
committed Details | Review
display-page: Hint about keyboard grab (2.20 KB, patch)
2015-02-13 17:24 UTC, Zeeshan Ali
committed Details | Review

Description Zeeshan Ali 2015-01-21 22:28:44 UTC
Latest spice-gtk added support for keyboard grab/ungrab. More details on that here:

https://bugs.freedesktop.org/show_bug.cgi?id=85331

While this works out of the box in Boxes, user is not informed about this in any way. We should show hints to user about this, very similar to the "(press [left] Ctrl+Alt keys to ungrab)" hint we show when mouse is grabbed. It will need support from spice though:

https://bugs.freedesktop.org/show_bug.cgi?id=85331#c5
Comment 1 Marc-Andre Lureau 2015-01-22 00:52:07 UTC
imho, this is an "advanced" binding, and should just be documented in manual, not cluttering the UI. my 2c
Comment 2 Pavel Grunt 2015-01-22 09:32:13 UTC
It is possible to use the "keyboard-grab" signal which is emitted when the grab changes.
Comment 3 Zeeshan Ali 2015-01-22 13:46:13 UTC
(In reply to comment #2)
> It is possible to use the "keyboard-grab" signal which is emitted when the grab
> changes.

yes but it doesn't tell me what the change was so i can't really use it.
Comment 4 Zeeshan Ali 2015-01-22 13:46:46 UTC
(In reply to comment #1)
> imho, this is an "advanced" binding, and should just be documented in manual,
> not cluttering the UI. my 2c

hmm.. maybe you are right.
Comment 5 Pavel Grunt 2015-01-22 13:50:12 UTC
Created attachment 295171 [details] [review]
Use "keyboard-grab" signal to detect the change of the grab
Comment 6 Zeeshan Ali 2015-01-22 14:08:15 UTC
Review of attachment 295171 [details] [review]:

Good patch but I think we want a different hint displayed for this keyboard grab since the kbd grab is not really user-visible, like mouse-grab.

::: src/spice-display.vala
@@ +122,3 @@
                 mouse_grabbed = status != 0;
             });
+            display.keyboard_grab.connect((status) => {

Ah, I missed the fact that it has a status argument.
Comment 7 Marc-Andre Lureau 2015-01-22 14:10:33 UTC
Review of attachment 295171 [details] [review]:

I wouldn't update this title here, but I let designers and maintainers decide.
Comment 8 Pavel Grunt 2015-01-22 15:39:17 UTC
Created attachment 295190 [details] [review]
Give hint about keyboard ungrab / grab
Comment 9 Zeeshan Ali 2015-01-22 16:41:16 UTC
Review of attachment 295190 [details] [review]:

* Give hint -> Hint (since it can be used as verb itself)
* Use tend to use prefix in shortlog. "display: " would be appropriate here.
* A bit of description would be nice.

::: src/display-page.vala
@@ +99,3 @@
         string? hint = null;
         if (grabbed)
+            hint = _("All keys currently received by guest. Press & release Ctrl+Alt to change.");

I think 'guest' -> name of machine (in '' since it can have spaces).

@@ -99,3 @@
         string? hint = null;
         if (grabbed)
-            hint = _("(press [left] Ctrl+Alt keys to ungrab)");

We still want this for mouse grab. I think we should rename 'grabbed' to 'mouse_grabbed' and create a new property for keyboard grab.

@@ +101,3 @@
+            hint = _("All keys currently received by guest. Press & release Ctrl+Alt to change.");
+        else if (event_box.get_child ().has_focus)
+            hint = _("All keys currently received by client. Press & release Ctrl+Alt to change.");

similarly, client -> hostname.

::: src/display.vala
@@ +9,3 @@
     public bool can_grab_mouse { get; protected set; }
     public bool mouse_grabbed { get; protected set; }
+    public bool keyboard_grabbed { get; protected set; }

Addition of this property is a different logical change so lets put that in a separate patch.
Comment 10 Zeeshan Ali 2015-02-04 18:15:24 UTC
(In reply to comment #4)
> (In reply to comment #1)
> > imho, this is an "advanced" binding, and should just be documented in manual,
> > not cluttering the UI. my 2c
> 
> hmm.. maybe you are right.

Thinking about accessibility, I think it would be good to provide the hint for disabled users who dont have a pointing device and have not yet read the manual.

Pavel, Do you intend to fix the patch as per last review?
Comment 11 Pavel Grunt 2015-02-05 10:51:48 UTC
Created attachment 296181 [details] [review]
display: add keyboard grabbed property
Comment 12 Pavel Grunt 2015-02-05 10:52:41 UTC
Created attachment 296182 [details] [review]
display-page: Hint about keyboard grab
Comment 13 Zeeshan Ali 2015-02-05 19:21:35 UTC
Review of attachment 296181 [details] [review]:

Looks good. I'll Capitalize 'add' before pushing..
Comment 14 Zeeshan Ali 2015-02-05 19:39:14 UTC
Review of attachment 296182 [details] [review]:

Some nitpicks on the description while you are fixing other things:

* "an user" -> "the user" (or just 'users').
* "is possible" -> "".
* Its also for sending keys to host system (e.g Super key after ungrab should launch overview mode of gnome-shell). I'd just remove the last line.
* Please put '.' after sentences.

::: src/display-page.vala
@@ +34,3 @@
         }
     }
+    private bool mouse_grabbed {

Separate change (along with update of its current usage below) so separate patch.

@@ +43,3 @@
+            return display != null ? display.keyboard_grabbed : false;
+        }
+    }

Ideally this should also go into separate patch but not biggie since its private.

@@ +103,2 @@
         string? hint = null;
+        if (can_grab_mouse) {

Do we really need to care about this? I'd go with much simpler logic:

if (mouse_grabbed)
   hint = _("(press [left] Ctrl+Alt keys to ungrab)");
else if (keyboard_grabbed)
   hint = _("All keys currently received by guest. Press & release Ctrl+Alt to change.");
else if ((event_box.get_child ().has_focus)
   hint = _("All keys currently received by client. Press & release Ctrl+Alt to change.");

Unless there is something wrong with this logic?

@@ +109,3 @@
+                hint = _("All keys currently received by guest. Press & release Ctrl+Alt to change.");
+            else if (event_box.get_child ().has_focus)
+                hint = _("All keys currently received by client. Press & release Ctrl+Alt to change.");

As pointed out in previous review:

* I think 'guest' -> name of machine (in '' since it can have spaces).
* similarly, client -> hostname.

@@ +137,3 @@
             });
         });
+        display_grabbed_id = display.notify["keyboard-grabbed"].connect(() => {

display_grabbed_id is already being used for mouse-grabbed notify. Just like the property rename, you want to rename this field and add a new separate one for keyboard-grabbed notify.

@@ +159,3 @@
         event_box.add (widget);
         event_box.show_all ();
+        update_subtitle ();

Why do we need to bring this call down here?
Comment 15 Pavel Grunt 2015-02-06 09:19:24 UTC
(In reply to comment #14)

> Do we really need to care about this? I'd go with much simpler logic:
> 
> if (mouse_grabbed)
>    hint = _("(press [left] Ctrl+Alt keys to ungrab)");
> else if (keyboard_grabbed)
>    hint = _("All keys currently received by guest. Press & release Ctrl+Alt to
> change.");
> else if ((event_box.get_child ().has_focus)
>    hint = _("All keys currently received by client. Press & release Ctrl+Alt to
> change.");
> 
> Unless there is something wrong with this logic?
> 
Try to connect to a machine which doesn't have the spice vdagent. In that case changes of the subtitle looks strange.

> 
> @@ +159,3 @@
>          event_box.add (widget);
>          event_box.show_all ();
> +        update_subtitle ();
> 
> Why do we need to bring this call down here?

To avoid a runtime warning - the widget is not in the event_box and we do event_box.get_child ().has_focus...
Comment 16 Pavel Grunt 2015-02-10 09:10:36 UTC
Created attachment 296446 [details] [review]
display-page: Add keyboard grabbed property
Comment 17 Pavel Grunt 2015-02-10 09:11:32 UTC
Created attachment 296449 [details] [review]
display-page: Rename grabbed to mouse_grabbed
Comment 18 Pavel Grunt 2015-02-10 09:15:58 UTC
Created attachment 296450 [details] [review]
display-page: Hint about keyboard grab

Zeeshan, I don't know how to get the hostname, please add a patch for it.
Comment 19 Zeeshan Ali 2015-02-10 19:32:05 UTC
(In reply to Pavel Grunt from comment #18)
> Created attachment 296450 [details] [review] [review]
> display-page: Hint about keyboard grab
> 
> Zeeshan, I don't know how to get the hostname, please add a patch for it.

g_get_host_name(), in vala that is: GLib.Environment.get_host_name().
Comment 20 Zeeshan Ali 2015-02-10 19:38:13 UTC
(In reply to Pavel Grunt from comment #15)
> (In reply to comment #14)

Not a biggie but its usually better to use the 'Review' link to reply to inline comments.

> > Do we really need to care about this? I'd go with much simpler logic:
> > 
> > if (mouse_grabbed)
> >    hint = _("(press [left] Ctrl+Alt keys to ungrab)");
> > else if (keyboard_grabbed)
> >    hint = _("All keys currently received by guest. Press & release Ctrl+Alt to
> > change.");
> > else if ((event_box.get_child ().has_focus)
> >    hint = _("All keys currently received by client. Press & release Ctrl+Alt to
> > change.");
> > 
> > Unless there is something wrong with this logic?
> > 
> Try to connect to a machine which doesn't have the spice vdagent. In that
> case changes of the subtitle looks strange.

What happens in that case? Would be nice to find out why that is the case.

> > 
> > @@ +159,3 @@
> >          event_box.add (widget);
> >          event_box.show_all ();
> > +        update_subtitle ();
> > 
> > Why do we need to bring this call down here?
> 
> To avoid a runtime warning - the widget is not in the event_box and we do
> event_box.get_child ().has_focus...

That doesn't sound like a real solution. How about not calling .has_focus if there is no child yet? i-e lets add a null check to the 'if' condition making this call.
Comment 21 Pavel Grunt 2015-02-11 07:57:47 UTC
Created attachment 296563 [details] [review]
display-page: Hint about keyboard grab
Comment 22 Zeeshan Ali 2015-02-11 13:29:18 UTC
Review of attachment 296563 [details] [review]:

Looks good and i'll push once you answer the question in inline comment.

::: src/display-page.vala
@@ +108,3 @@
+            hint = keyboard_grab_fmt.printf (machine.name);
+        else if (event_box.get_child () != null && event_box.get_child ().has_focus)
+            hint = keyboard_grab_fmt.printf (GLib.Environment.get_host_name ());

1. Would be nicer if event_box.get_child () was put into a variable but I can handle that for you before pushing.

2. Whatever happened to this issue:

>> Try to connect to a machine which doesn't have the spice vdagent. In that
>> case changes of the subtitle looks strange.

> What happens in that case? Would be nice to find out why that is the case.

You can't reproduce the issue anymore?
Comment 23 Zeeshan Ali 2015-02-11 13:30:42 UTC
Review of attachment 296446 [details] [review]:

nitpick: Name the property as is: either '-' or '_' instead of space..
Comment 24 Zeeshan Ali 2015-02-11 13:31:13 UTC
Review of attachment 296449 [details] [review]:

ack
Comment 25 Pavel Grunt 2015-02-11 13:55:21 UTC
Review of attachment 296563 [details] [review]:

> 
> 1. Would be nicer if event_box.get_child () was put into a variable but I
> can handle that for you before pushing.
Thank you
> 
> 2. Whatever happened to this issue:
> 
> >> Try to connect to a machine which doesn't have the spice vdagent. In that
> >> case changes of the subtitle looks strange.
> 
> > What happens in that case? Would be nice to find out why that is the case.
> 
> You can't reproduce the issue anymore?

The issue is that the subtitle is switching between "(press [left] Ctrl+Alt keys to ungrab)" and "All keys currently received by client. Press & release Ctrl+Alt to change.".
I think that just hiding / showing the subtitle is better.
Comment 26 Zeeshan Ali 2015-02-11 14:16:56 UTC
(In reply to Pavel Grunt from comment #25)
> Review of attachment 296563 [details] [review] [review]:

Seems its very hard to click 'Review' button. :)

> > 2. Whatever happened to this issue:
> > 
> > >> Try to connect to a machine which doesn't have the spice vdagent. In that
> > >> case changes of the subtitle looks strange.
> > 
> > > What happens in that case? Would be nice to find out why that is the case.
> > 
> > You can't reproduce the issue anymore?
> 
> The issue is that the subtitle is switching between "(press [left] Ctrl+Alt
> keys to ungrab)" and "All keys currently received by client. Press & release
> Ctrl+Alt to change.".

Ah ok.

> I think that just hiding / showing the subtitle is better.

Yes, we shouldn't show any subtitle when mouse is grabbable but not grabbed.
Comment 27 Pavel Grunt 2015-02-11 15:32:22 UTC
Created attachment 296610 [details] [review]
display-page: Hint about keyboard grab
Comment 28 Zeeshan Ali 2015-02-12 17:20:31 UTC
Created attachment 296697 [details] [review]
display-page: Improved hint for upgrabbing
Comment 29 Zeeshan Ali 2015-02-12 17:20:48 UTC
Created attachment 296698 [details] [review]
display-page: Rename grabbed to mouse_grabbed

We'll soon want properties/fields for keyboard grab too so this is to
keep the code more clear/readable.

bsoletes: 296449 - display-page: Rename grabbed to mouse_grabbed
Comment 30 Zeeshan Ali 2015-02-12 17:21:03 UTC
Created attachment 296699 [details] [review]
display: Add keyboard_grabbed property

We'll need this in following patches for monitoring keyboard grab changes.
Comment 31 Zeeshan Ali 2015-02-12 17:21:28 UTC
Created attachment 296700 [details] [review]
display-page: Add keyboard_grabbed property
Comment 32 Zeeshan Ali 2015-02-12 17:21:43 UTC
Created attachment 296701 [details] [review]
display-page: Hint about keyboard grab

Inform users how to release the keyboard grab.

bsoletes: 296610 - display-page: Hint about keyboard grab
Comment 33 Zeeshan Ali 2015-02-12 17:31:11 UTC
So I fixed a few minor things and changed the actual patch (attachment 296701 [details] [review]) a lot! Now I know what you (Pavel) was talking about after some testing about the focus thing. The issue is that when you move mouse away from display widget, while the widget remains focused and most of the keys are still going to it, non-window-manager keys are not and spice declares this as !kbd_grab. i-e we are in a mixed weird state with no indication from spice about it.

So I decided to go with one of your original approaches and to only provide hint when kbd is grabbed completely. The main point was that if a first time user who doesn't have a pointing device (e.g blind users who rely heavily on keyboard navigation) and doesn't know of the shortcut, is easily able to figure out how to get out of the guest display.
Comment 34 Lasse Schuirmann 2015-02-12 18:18:45 UTC
Review of attachment 296697 [details] [review]:

looks good to me. Why didn't we do that in the first place, when we added the '[left]'...
Comment 35 Lasse Schuirmann 2015-02-12 18:22:57 UTC
Review of attachment 296698 [details] [review]:

Looks good otherwise.

::: src/display-page.vala
@@ +98,3 @@
         string? hint = null;
+        if (mouse_grabbed)
+            hint = _("(press [left] Ctrl+Alt keys to ungrab)");

Changing it back here?
Comment 36 Lasse Schuirmann 2015-02-12 18:26:55 UTC
Review of attachment 296699 [details] [review]:

ack
Comment 37 Lasse Schuirmann 2015-02-12 18:27:05 UTC
Review of attachment 296700 [details] [review]:

ack
Comment 38 Lasse Schuirmann 2015-02-12 18:29:17 UTC
Review of attachment 296701 [details] [review]:

::: src/display-page.vala
@@ -103,3 @@
         string? hint = null;
-        if (mouse_grabbed)
-            hint = _("(press [left] Ctrl+Alt keys to ungrab)");

this won't survive the rebase if you don't change back the comment in the needs-work patch
Comment 39 Zeeshan Ali 2015-02-13 11:40:47 UTC
Review of attachment 296698 [details] [review]:

::: src/display-page.vala
@@ +98,3 @@
         string? hint = null;
+        if (mouse_grabbed)
+            hint = _("(press [left] Ctrl+Alt keys to ungrab)");

Meh! I thought i fixed in all commits. :(
Comment 40 Zeeshan Ali 2015-02-13 11:46:48 UTC
Created attachment 296764 [details] [review]
display-page: Rename grabbed to mouse_grabbed

We'll soon want properties/fields for keyboard grab too so this is to
keep the code more clear/readable.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 41 Zeeshan Ali 2015-02-13 11:46:58 UTC
Created attachment 296765 [details] [review]
display: Add keyboard_grabbed property

We'll need this in following patches for monitoring keyboard grab changes.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 42 Zeeshan Ali 2015-02-13 11:47:12 UTC
Created attachment 296766 [details] [review]
display-page: Add keyboard_grabbed property

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 43 Zeeshan Ali 2015-02-13 11:47:22 UTC
Created attachment 296767 [details] [review]
display-page: Hint about keyboard grab

Inform users how to release the keyboard grab.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 44 Lasse Schuirmann 2015-02-13 15:53:23 UTC
Review of attachment 296764 [details] [review]:

ack for this patch but request for another in comment below.

::: src/display-page.vala
@@ +162,3 @@
         }
 
         if (display_can_grab_id != 0) {

I'd rename display_can_grab_id to can_grab_mouse_id too (in a seperate patch). Then we have no displays grabbing things anymore in this file.
Comment 45 Lasse Schuirmann 2015-02-13 16:13:11 UTC
Review of attachment 296765 [details] [review]:

ack
Comment 46 Lasse Schuirmann 2015-02-13 16:13:33 UTC
Review of attachment 296766 [details] [review]:

ack
Comment 47 Lasse Schuirmann 2015-02-13 16:19:58 UTC
Review of attachment 296767 [details] [review]:

::: src/display-page.vala
@@ +107,3 @@
+                hint = _("Press (left) Ctrl+Alt to ungrab");
+        } else if (keyboard_grabbed) {
+            hint = _("Press & release (left) Ctrl+Alt to ungrab keyboard.");

Does the user really have to release Ctrl+Alt? Does that mean that Ctrl+Alt+<any key> will be delivered to the VM? This would be a bad behaviour IMO. If not I don't think it's rectified to further increase code complexity for an own messsage just for keyboard grabbing.

The first message is pretty generic and the second doesn't add real information for me.

@@ +136,3 @@
         });
+        keyboard_grabbed_id = display.notify["keyboard-grabbed"].connect(() => {
+            update_subtitle ();

a few lines above an author states:

            // In some cases this is sent inside size_allocate (see bug #692465)
            // which causes the label change queue_resize to be ignored
            // So we delay the update_title call to an idle to work around this.
            Idle.add_full (Priority.HIGH, () => {
                update_title ();
                return false;
            });

This would apply here to, wouldn't it?
Comment 48 Zeeshan Ali 2015-02-13 16:30:25 UTC
Review of attachment 296767 [details] [review]:

::: src/display-page.vala
@@ +107,3 @@
+                hint = _("Press (left) Ctrl+Alt to ungrab");
+        } else if (keyboard_grabbed) {
+            hint = _("Press & release (left) Ctrl+Alt to ungrab keyboard.");

No, just ctrl+alt, as already discussed on this bug. Stress on the word 'release' here.

Well second one is about ungrabbing kbd only (mouse is free) and in case of kbd ungrab, you have to release too (not only press) so we gotta specify.

@@ +136,3 @@
         });
+        keyboard_grabbed_id = display.notify["keyboard-grabbed"].connect(() => {
+            update_subtitle ();

Good catch. That will probably explain the gtk warnings I saw. I'll check..
Comment 49 Zeeshan Ali 2015-02-13 16:41:26 UTC
Created attachment 296786 [details] [review]
display-page: Hint about keyboard grab

Although the gtk+ critical I'm getting turned out to be irrelvant to this, I've now put the title update call in an idle call..
Comment 50 Lasse Schuirmann 2015-02-13 16:42:48 UTC
Review of attachment 296767 [details] [review]:

::: src/display-page.vala
@@ +107,3 @@
+                hint = _("Press (left) Ctrl+Alt to ungrab");
+        } else if (keyboard_grabbed) {
+            hint = _("Press & release (left) Ctrl+Alt to ungrab keyboard.");

What I mean is, you don't have to release ctrl+alt to ungrab the keyboard IIUC.

So if you press Ctrl+Alt and hold, keyboard gets released (as the mouse would). So if you now add another key the whole thing will go to the host system so actually "Press (left) Ctrl+Alt to ungrab" is more precise than "Press & release"
Comment 51 Zeeshan Ali 2015-02-13 16:50:45 UTC
Review of attachment 296767 [details] [review]:

::: src/display-page.vala
@@ +107,3 @@
+                hint = _("Press (left) Ctrl+Alt to ungrab");
+        } else if (keyboard_grabbed) {
+            hint = _("Press & release (left) Ctrl+Alt to ungrab keyboard.");

Yes, you *do* have to release ctrl+alt in this mode. You are confusing the (existing) case of mouse grab with the (new in spice) kbd grab.
Comment 52 Lasse Schuirmann 2015-02-13 17:03:05 UTC
Review of attachment 296786 [details] [review]:

I'm not able to test but given what you write is true this commit is good. So ack.

However in this case I dislike the behaviour by itself due to its inconsistency which is in turn not a Boxes issue.
Comment 53 Zeeshan Ali 2015-02-13 17:23:43 UTC
Created attachment 296790 [details] [review]
display-page: More specific names for grab props

We'll soon want properties/fields for keyboard grab too so this is to
keep the code more clear/readable.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 54 Zeeshan Ali 2015-02-13 17:23:52 UTC
Created attachment 296791 [details] [review]
display: Add keyboard_grabbed property

We'll need this in following patches for monitoring keyboard grab changes.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 55 Zeeshan Ali 2015-02-13 17:24:00 UTC
Created attachment 296792 [details] [review]
display-page: Add keyboard_grabbed property

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 56 Zeeshan Ali 2015-02-13 17:24:08 UTC
Created attachment 296793 [details] [review]
display-page: Hint about keyboard grab

Inform users how to release the keyboard grab.

Co-author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
Comment 57 Zeeshan Ali 2015-02-13 17:24:40 UTC
Attachment 296697 [details] pushed as d3e9923 - display-page: Improved hint for upgrabbing
Attachment 296790 [details] pushed as 9028df0 - display-page: More specific names for grab props
Attachment 296791 [details] pushed as 8edbf41 - display: Add keyboard_grabbed property
Attachment 296792 [details] pushed as 265ff6f - display-page: Add keyboard_grabbed property
Attachment 296793 [details] pushed as 27435e0 - display-page: Hint about keyboard grab