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 664218 - Enter should activate the default "Continue" button in the wizard
Enter should activate the default "Continue" button in the wizard
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: wizard
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
3.8.2
Depends on:
Blocks: 686781
 
 
Reported: 2011-11-16 18:10 UTC by Cosimo Cecchi
Modified: 2016-03-31 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wizard: Go to next page if a setup entry activates (2.90 KB, patch)
2013-04-10 19:10 UTC, Zeeshan Ali
reviewed Details | Review
wizard: Focus sensitive Continue/Create buttons (1.80 KB, patch)
2013-04-11 01:14 UTC, Zeeshan Ali
committed Details | Review
unattended-installer: Use correct API for grabbing focus (1.05 KB, patch)
2013-04-11 01:14 UTC, Zeeshan Ali
committed Details | Review
wizard: Go to next page if a setup entry activates (4.23 KB, patch)
2013-04-17 23:59 UTC, Zeeshan Ali
committed Details | Review
Revert "wizard: Focus sensitive Continue/Create buttons" (1.80 KB, patch)
2013-04-18 00:00 UTC, Zeeshan Ali
committed Details | Review

Description Cosimo Cecchi 2011-11-16 18:10:52 UTC
Pressing Enter in the wizard should always activate the default Continue action if it's sensitive. In particular, pressing Enter in the "Select a file/URL" GtkEntry should activate Continue with that URL.
Comment 1 Marc-Andre Lureau 2011-11-16 18:41:40 UTC
not so easy, grab_focus() doesn't seem to work well when turning pages. More investigation needed. Furthermore, clutter-gtk grab chain is broken, making this feature a bit useful that is seems in the "Select Source" page for example
Comment 2 Marc-Andre Lureau 2011-11-16 18:47:19 UTC
As you mentionned in IRC, we should make use of:

gtk_entry_set_activates_default() and 
gtk_widget_set_receives_default()
Comment 3 Zeeshan Ali 2012-10-16 13:07:08 UTC
(In reply to comment #2)
> As you mentionned in IRC, we should make use of:
> 
> gtk_entry_set_activates_default() and 
> gtk_widget_set_receives_default()

Doesn't that require both the source and target widgets to be on the same level in widget hierarchy (as in directly under  the same container)?
Comment 4 Matthias Clasen 2013-04-10 10:53:25 UTC
no
Comment 5 Zeeshan Ali 2013-04-10 12:56:35 UTC
(In reply to comment #4)
> no

even if there is clutter actors involved? The reason I'm asking this is cause I tried to solve this bug when it was filed and failed to do so, at least by making use of gtk_entry_set_activates_default() and  gtk_widget_set_receives_default(). I'll give it another try now..
Comment 6 Zeeshan Ali 2013-04-10 16:09:07 UTC
(In reply to comment #0)
> In particular, pressing Enter in the "Select a file/URL"
> GtkEntry should activate Continue with that URL.

This one seems to be already fixed. I'll look into the setup page entries now.
Comment 7 Zeeshan Ali 2013-04-10 19:10:28 UTC
Created attachment 241203 [details] [review]
wizard: Go to next page if a setup entry activates

But before we do, ensure user has provided all required info.
Comment 8 Zeeshan Ali 2013-04-10 19:49:26 UTC
Review of attachment 241203 [details] [review]:

::: src/installer-media.vala
@@ +20,3 @@
     public virtual bool need_user_input_for_vm_creation { get { return false; } }
     public virtual bool ready_to_create { get { return true; } }
+    public virtual bool user_wants_to_create { get; protected set; } // User wants to already create the VM

Not exactly happy with achieving the goal with this property but apart from the receives_default/activate_default (which doesn't work out of the box at least), I couldn't think of a better way.
Comment 9 Zeeshan Ali 2013-04-11 01:14:08 UTC
Created attachment 241216 [details] [review]
wizard: Focus sensitive Continue/Create buttons

Continue/Create button should have the focus when they are sensitive.
Them being sensitive means that everything is ready for us to proceed to
next step and so we should make it very easy for user to quickly move to
next step. In most cases, this will enable users to create VMs very
quickly IMO.
Comment 10 Zeeshan Ali 2013-04-11 01:14:15 UTC
Created attachment 241217 [details] [review]
unattended-installer: Use correct API for grabbing focus

Gtk.Widget.is_focus is not for grabbing focus but dictates whether the
widget is the focus widget within the toplevel or not.
Comment 11 Zeeshan Ali 2013-04-13 15:44:42 UTC
Working patches are already provided so this should go to 3.8.
Comment 12 Matthias Clasen 2013-04-13 15:55:34 UTC
would be nice to have in 3.8.1, indeed
Comment 13 Christophe Fergeau 2013-04-15 12:18:11 UTC
Review of attachment 241216 [details] [review]:

Makes sense
Comment 14 Christophe Fergeau 2013-04-15 12:19:36 UTC
Review of attachment 241217 [details] [review]:

Was this causing some bug? I guess the entry was not focused as expected?
Comment 15 Christophe Fergeau 2013-04-15 12:35:46 UTC
Review of attachment 241203 [details] [review]:

Hmm I'd do something different here (which is already done for the ovirt login/password): as long as everything is not filled in, "enter" moves to the next entry to fill. After filling the last one, it moves to the 'login' button, but you need to press 'enter' once more to activate it. "enter" more or less behaves as "tab" there.

Would also be nice to know why receives_default/activate_default is not working as expected... Maybe you need to call gtk_widget_grab_default() as well?
Comment 16 Zeeshan Ali 2013-04-15 13:10:53 UTC
Review of attachment 241217 [details] [review]:

No, it works fine AFAICT. This is just to do it the right way.
Comment 17 Zeeshan Ali 2013-04-15 17:31:13 UTC
Review of attachment 241203 [details] [review]:

I don't think I agree. TAB is the well-known method to go to next entry and ENTER is usually for "I am done". With this patch, user remains in the same entry if he/she hits ENTER while there is still mandatory fields to be filled. We should probably move the focus to next mandatory entry if current one is filled on ENTER too but that can be added later.

Question now is that if this patch could go in time for 3.8.1?
Comment 18 Zeeshan Ali 2013-04-15 17:37:54 UTC
Attachment 241216 [details] pushed as be58c07 - wizard: Focus sensitive Continue/Create buttons
Attachment 241217 [details] pushed as 5bbb139 - unattended-installer: Use correct API for grabbing focus
Comment 19 Christophe Fergeau 2013-04-15 18:39:37 UTC
(In reply to comment #17)
> Review of attachment 241203 [details] [review]:
> 
> I don't think I agree. TAB is the well-known method to go to next entry and
> ENTER is usually for "I am done". With this patch, user remains in the same
> entry if he/she hits ENTER while there is still mandatory fields to be filled.
> We should probably move the focus to next mandatory entry if current one is
> filled on ENTER too but that can be added later.

I think we agree about the behaviour then.

> Question now is that if this patch could go in time for 3.8.1?

Let's say I missed this second paragraph, just as you missed the second paragraph from comment #15 ;)

Given that we agree that the behaviour after this patch is suboptimal, and we also agree that the implementation could be nicer, and given that the bug it fixes is not a very bad bug, I think it's better to punt that patch for 3.8.1.
Comment 20 Zeeshan Ali 2013-04-15 19:04:33 UTC
(In reply to comment #19)
> (In reply to comment #17)
> > Review of attachment 241203 [details] [review] [details]:
> > 
> > I don't think I agree. TAB is the well-known method to go to next entry and
> > ENTER is usually for "I am done". With this patch, user remains in the same
> > entry if he/she hits ENTER while there is still mandatory fields to be filled.
> > We should probably move the focus to next mandatory entry if current one is
> > filled on ENTER too but that can be added later.
> 
> I think we agree about the behaviour then.

Almost :) See below.

> > Question now is that if this patch could go in time for 3.8.1?
> 
> Let's say I missed this second paragraph, just as you missed the second
> paragraph from comment #15 ;)

About  receives_default/activate_default  not working? I didn't miss it. I just don't know. Will need to test/research more.

> Given that we agree that the behaviour after this patch is suboptimal, and we
> also agree that the implementation could be nicer, and given that the bug it
> fixes is not a very bad bug, I think it's better to punt that patch for 3.8.1.

Well, there is also that this patch still improves the current behavior IMO and hence my question.
Comment 21 Christophe Fergeau 2013-04-15 19:13:11 UTC
(In reply to comment #20)
> Well, there is also that this patch still improves the current behavior IMO and
> hence my question.

I more or less answered that, given that improvement is very minor, implementation needs work, so does the behaviour, I'd just punt this patch to 3.8.2.
Comment 22 Zeeshan Ali 2013-04-17 23:59:53 UTC
Created attachment 241784 [details] [review]
wizard: Go to next page if a setup entry activates

But before we do, ensure user has provided all required info. If all
required info is not yet provided, take user to next required entry that
is still awaiting input.
Comment 23 Zeeshan Ali 2013-04-18 00:00:03 UTC
Created attachment 241785 [details] [review]
Revert "wizard: Focus sensitive Continue/Create buttons"

This reverts commit be58c071894b46090f51c1ccbaaff1892d16375a.

This turned out to be a really bad idea: even a single character in
username entry is sufficient for us to declare that we have all the
needed info so username entry keeps loosing focus while user is trying
to type in it.
Comment 24 Christophe Fergeau 2013-04-18 14:56:17 UTC
Comment on attachment 241785 [details] [review]
Revert "wizard: Focus sensitive Continue/Create buttons"

Attachment 241785 [details] pushed as 6d37c8d - Revert "wizard: Focus sensitive Continue/Create buttons"
Comment 25 Zeeshan Ali 2013-05-08 02:01:12 UTC
Review of attachment 241784 [details] [review]:

Almost forgot about this patch/bug. Christophe, IIRC this patch is now only waiting because I haven't found out why gtk_widget_recieves/activate_default() doesn't work? If so, I think thats relevant to the other (already committed) patches and not this one. I'm probably missing something though?
Comment 26 Christophe Fergeau 2013-05-13 11:59:38 UTC
Review of attachment 241784 [details] [review]:

My understanding was that user_wants_to_create (); was needed as a workaround for this unspecified gtk_widget_receives_default() issue, which means this is relevant to this bug.
Comment 27 Zeeshan Ali 2013-05-13 13:27:15 UTC
Review of attachment 241784 [details] [review]:

Well the unattended installer shouldn't be accessing App.app.window in setup_ui IMO so gtk_windows_activate_default() can't replace user_wants_to_create(). Same goes for wizard calling App.app.window.activate_default(). Its not its place to do that and thinking about this, I'm even worried it will cause some weird side-effects (if not now, then in future).
Comment 28 Zeeshan Ali 2013-05-13 22:55:02 UTC
Attachment 241784 [details] pushed as 0461f03 - wizard: Go to next page if a setup entry activates