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 767295 - Hitting ENTER inside TpawAccountWidget doesn't emit GtkDialog::response
Hitting ENTER inside TpawAccountWidget doesn't emit GtkDialog::response
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: tp-aw
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2016-06-06 15:37 UTC by Debarshi Ray
Modified: 2016-06-07 07:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
account-widget: Hitting ENTER should also emit GtkDialog::response (2.11 KB, patch)
2016-06-06 15:39 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-06-06 15:37:16 UTC
If TpawAccountWidget is placed inside a GtkDialog, then clicking one of the response buttons emits GtkDialog::response, as one would expect. However, just hitting ENTER inside a GtkEntry doesn't. This is an awkward inconsistency for applications using this widget.

(Once the account has been created and ready to use, TpawAccountWidget::close is emitted. Without a GtkDialog, as in empathy, there is no GtkDialog::response and TpawAccountWidget::close is the only signal that is emitted.)

I don't know of a way to mask the emission of GtkDialog::response because this is a dialog that has been handed down to us from outside, and since there is obvious value in addressing this inconsistency, I think we should ensure that the same signals are emitted regardless of how the form was filled.

See bug 730578 for the change to allow specifying a GtkDialog during construction.
Comment 1 Debarshi Ray 2016-06-06 15:39:35 UTC
Created attachment 329204 [details] [review]
account-widget: Hitting ENTER should also emit GtkDialog::response
Comment 2 Debarshi Ray 2016-06-06 15:50:46 UTC
Since it took me a while to untangle the whole yarn, here is a more verbose account of what is going on here:

There are two possibilities when adding an account:
    
- The user hits ENTER after entering the credentials. GtkDialog::response won't be emitted. Instead, only TpawAccountWidget::close will be emitted once the TpAccount has been created and ready for use.
    
- The user clicks the Add button. GtkDialog::response will be emitted with GTK_RESPONSE_APPLY. At this point the operation has just begun - the TpAccount hasn't even been created. Once it is ready, TpawAccountWidget::close will be emitted.

Note that this doesn't affect users of this API who don't pass a GtkDialog during construction. So, gnome-control-center / gnome-online-accounts is affected, but empathy isn't.
Comment 3 Debarshi Ray 2016-06-07 07:45:52 UTC
Comment on attachment 329204 [details] [review]
account-widget: Hitting ENTER should also emit GtkDialog::response

Pushed to master.