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 766670 - Nicer profile picture (avatar) selection
Nicer profile picture (avatar) selection
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: User Accounts
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on: 792243
Blocks:
 
 
Reported: 2016-05-19 15:27 UTC by Allan Day
Modified: 2018-02-09 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
user-accounts: Turn UmPhotoDialog in a full GObject (3.25 KB, patch)
2018-01-31 15:04 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce a UI template for UmPhotoDialog (2.87 KB, patch)
2018-01-31 15:04 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce the new Avatar Chooser popover (19.20 KB, patch)
2018-01-31 15:04 UTC, Felipe Borges
none Details | Review
user-accounts: Make the avatar entries rounded (2.46 KB, patch)
2018-01-31 15:38 UTC, Felipe Borges
none Details | Review
avatar-chooser-screenshot (170.03 KB, image/png)
2018-01-31 15:41 UTC, Felipe Borges
  Details
user-accounts: Turn UmPhotoDialog in a full GObject (3.81 KB, patch)
2018-02-02 13:21 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce a UI template for UmPhotoDialog (2.51 KB, patch)
2018-02-02 13:21 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce the new Avatar Chooser popover (18.86 KB, patch)
2018-02-02 13:22 UTC, Felipe Borges
none Details | Review
user-accounts: Make the avatar entries rounded (2.46 KB, patch)
2018-02-02 13:22 UTC, Felipe Borges
none Details | Review
user-accounts: Turn UmPhotoDialog in a full GObject (3.80 KB, patch)
2018-02-02 14:50 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce a UI template for UmPhotoDialog (2.51 KB, patch)
2018-02-02 14:50 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce the new Avatar Chooser popover (18.79 KB, patch)
2018-02-02 14:50 UTC, Felipe Borges
none Details | Review
user-accounts: Make the avatar entries rounded (2.42 KB, patch)
2018-02-02 14:50 UTC, Felipe Borges
none Details | Review
user-accounts: Turn UmPhotoDialog in a full GObject (3.80 KB, patch)
2018-02-02 15:39 UTC, Felipe Borges
committed Details | Review
user-accounts: Introduce a UI template for UmPhotoDialog (2.51 KB, patch)
2018-02-02 15:39 UTC, Felipe Borges
committed Details | Review
user-accounts: Introduce the new Avatar Chooser popover (19.21 KB, patch)
2018-02-02 15:39 UTC, Felipe Borges
none Details | Review
user-accounts: Make the avatar entries rounded (2.42 KB, patch)
2018-02-02 15:39 UTC, Felipe Borges
none Details | Review
user-accounts: Render user images with CSS (8.00 KB, patch)
2018-02-02 17:08 UTC, Felipe Borges
reviewed Details | Review
user-accounts: Introduce the new Avatar Chooser popover (19.21 KB, patch)
2018-02-05 12:07 UTC, Felipe Borges
none Details | Review
user-accounts: Introduce the new Avatar Chooser popover (19.22 KB, patch)
2018-02-05 12:08 UTC, Felipe Borges
committed Details | Review
user-accounts: Make the avatar entries rounded (5.66 KB, patch)
2018-02-05 12:54 UTC, Felipe Borges
reviewed Details | Review

Description Allan Day 2016-05-19 15:27:47 UTC
The current UI for selecting a profile picture is a bit limited and not particularly great looking. The pictures are really small, you have to open a file chooser to select a picture, there's no way to view previously used profile pictures, or to select a profile picture from one of your online accounts.

There are some new designs that seek to resolve these issues and provide a much nicer experience, using more standard GNOME 3 design patterns:

https://wiki.gnome.org/Design/OS/AvatarChooser

Note that this design is intended to be used by initial setup also.
Comment 1 Felipe Borges 2018-01-10 13:24:36 UTC
I have been implementing this in a wip branch ~> https://git.gnome.org/browse/gnome-control-center/log/?h=wip/feborges/avatar-chooser
Comment 2 Felipe Borges 2018-01-31 15:04:24 UTC
Created attachment 367708 [details] [review]
user-accounts: Turn UmPhotoDialog in a full GObject

For the new avatar-chooser implementation we will use Gtk+ widget
composite templates.
Comment 3 Felipe Borges 2018-01-31 15:04:30 UTC
Created attachment 367709 [details] [review]
user-accounts: Introduce a UI template for UmPhotoDialog
Comment 4 Felipe Borges 2018-01-31 15:04:36 UTC
Created attachment 367710 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 5 Felipe Borges 2018-01-31 15:06:03 UTC
The current implementation does not introduce visible regressions to the old one.

TODO:

 * Pick images from online accounts
 * List recently used pictures
 * Generate avatar automatically (with the initial letter, like gmail)
Comment 6 Felipe Borges 2018-01-31 15:38:32 UTC
Created attachment 367714 [details] [review]
user-accounts: Make the avatar entries rounded

See mockups at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 7 Felipe Borges 2018-01-31 15:41:55 UTC
Created attachment 367715 [details]
avatar-chooser-screenshot

Allan, should the avatar shown in the panel also be rounded? (See screenshot)
Comment 8 Ondrej Holy 2018-02-01 08:49:23 UTC
> Allan, should the avatar shown in the panel also be rounded? (See screenshot)

And in carousel?
Comment 9 Ondrej Holy 2018-02-01 09:46:41 UTC
Review of attachment 367708 [details] [review]:

Looks ok, just see my comment on the following patches.

::: panels/user-accounts/um-photo-dialog.c
@@ +601,1 @@
+        g_clear_object (&um->thumb_factory);

This is not necessarily related to GObject transformations, but ok.
Comment 10 Ondrej Holy 2018-02-01 09:46:43 UTC
Review of attachment 367709 [details] [review]:

Looks ok, just not sure that this patch makes much sense without the following one, but definitely easier for review.

::: panels/user-accounts/um-photo-dialog.c
@@ +572,3 @@
         UmPhotoDialog *um;
 
+        um = g_object_new (UM_TYPE_PHOTO_DIALOG, NULL);

This should be part of the previous patch I suppose.

@@ +618,3 @@
 {
+        GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass);
+        GObjectClass   *oclass = G_OBJECT_CLASS (klass);

The alignment of variables isn't probably wanted here, but that's detail.
Comment 11 Ondrej Holy 2018-02-01 09:46:45 UTC
Review of attachment 367710 [details] [review]:

Popover should be probably closed after avatar selection, but it isn't.

::: panels/user-accounts/um-photo-dialog.c
@@ +45,2 @@
 struct _UmPhotoDialog {
+        GtkPopover parent;

Shouldn't this be also part of the first patch? Maybe better to merge them, but nothing crucial.

@@ +459,3 @@
+        um = g_object_new (UM_TYPE_PHOTO_DIALOG,
+                           "relative-to", button,
+                           NULL);

dtto

@@ +465,3 @@
         /* Set up the popup */
         um->popup_button = button;
+

Please don't...
Comment 12 Ondrej Holy 2018-02-01 09:46:50 UTC
Review of attachment 367714 [details] [review]:

As per Comment 9, but please discuss it with designers.

See also:
./../gnome-control-center/panels/user-accounts/um-photo-dialog.c: In function ‘create_face_widget’:
../../gnome-control-center/panels/user-accounts/um-photo-dialog.c:359:32: warning: unknown conversion type character ‘}’ in format [-Wformat=]
         css = g_strdup_printf ("* {\n"
                                ^~~~~~~
../../gnome-control-center/panels/user-accounts/um-photo-dialog.c:362:54: note: format string is defined here
                                "  border-radius: 50% }\n", uri);
Comment 13 Ondrej Holy 2018-02-01 09:47:33 UTC
I also see the following when closing after avatar change, not sure this is stricly related to this bug though:

(gnome-control-center:29163): GLib-GObject-CRITICAL **: 10:18:06.144: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Thread 1 "gnome-control-c" received signal SIGTRAP, Trace/breakpoint trap.
_g_log_abort (breakpoint=1) at /home/oholy/gnome/glib/glib/gmessages.c:583
583	}
(gdb) bt
  • #0 _g_log_abort
    at /home/oholy/gnome/glib/glib/gmessages.c line 583
  • #1 g_logv
    at /home/oholy/gnome/glib/glib/gmessages.c line 1391
  • #2 g_log
    at /home/oholy/gnome/glib/glib/gmessages.c line 1432
  • #3 g_return_if_fail_warning
  • #4 g_object_unref
    at /home/oholy/gnome/glib/gobject/gobject.c line 3235
  • #5 um_user_image_finalize
    at ../../gnome-control-center/panels/user-accounts/um-user-image.c line 68
  • #6 g_object_unref
    at /home/oholy/gnome/glib/gobject/gobject.c line 3338
  • #7 g_object_run_dispose
    at /home/oholy/gnome/glib/gobject/gobject.c line 1102
  • #8 gtk_widget_destroy
    at /home/oholy/gnome/gtk+/gtk/gtkwidget.c line 4722

Comment 14 Felipe Borges 2018-02-02 13:21:47 UTC
Created attachment 367806 [details] [review]
user-accounts: Turn UmPhotoDialog in a full GObject

For the new avatar-chooser implementation we will use Gtk+ widget
composite templates.
Comment 15 Felipe Borges 2018-02-02 13:21:54 UTC
Created attachment 367807 [details] [review]
user-accounts: Introduce a UI template for UmPhotoDialog
Comment 16 Felipe Borges 2018-02-02 13:22:00 UTC
Created attachment 367808 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 17 Felipe Borges 2018-02-02 13:22:07 UTC
Created attachment 367809 [details] [review]
user-accounts: Make the avatar entries rounded

See mockups at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 18 Ondrej Holy 2018-02-02 14:19:28 UTC
Review of attachment 367808 [details] [review]:

Seems that it is not applicable on master, can you please do something with it?
Comment 19 Felipe Borges 2018-02-02 14:50:03 UTC
Created attachment 367814 [details] [review]
user-accounts: Turn UmPhotoDialog in a full GObject

For the new avatar-chooser implementation we will use Gtk+ widget
composite templates.
Comment 20 Felipe Borges 2018-02-02 14:50:09 UTC
Created attachment 367815 [details] [review]
user-accounts: Introduce a UI template for UmPhotoDialog
Comment 21 Felipe Borges 2018-02-02 14:50:16 UTC
Created attachment 367816 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 22 Felipe Borges 2018-02-02 14:50:21 UTC
Created attachment 367817 [details] [review]
user-accounts: Make the avatar entries rounded

See mockups at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 23 Ondrej Holy 2018-02-02 15:13:26 UTC
Review of attachment 367814 [details] [review]:

Looks ok, but please push all the three together...
Comment 24 Ondrej Holy 2018-02-02 15:13:29 UTC
Review of attachment 367815 [details] [review]:

dtto
Comment 25 Ondrej Holy 2018-02-02 15:13:37 UTC
Review of attachment 367816 [details] [review]:

The popover is not closed after "Take a picture...", not "Select a file...".
Comment 26 Ondrej Holy 2018-02-02 15:13:46 UTC
Review of attachment 367817 [details] [review]:

Doesn't make sense to me without changes in other places...
Comment 27 Ondrej Holy 2018-02-02 15:14:14 UTC
Also would be nice to propose same changes for g-i-s.
Comment 28 Felipe Borges 2018-02-02 15:39:07 UTC
Created attachment 367819 [details] [review]
user-accounts: Turn UmPhotoDialog in a full GObject

For the new avatar-chooser implementation we will use Gtk+ widget
composite templates.
Comment 29 Felipe Borges 2018-02-02 15:39:12 UTC
Created attachment 367820 [details] [review]
user-accounts: Introduce a UI template for UmPhotoDialog
Comment 30 Felipe Borges 2018-02-02 15:39:19 UTC
Created attachment 367821 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 31 Felipe Borges 2018-02-02 15:39:25 UTC
Created attachment 367822 [details] [review]
user-accounts: Make the avatar entries rounded

See mockups at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 32 Felipe Borges 2018-02-02 17:08:05 UTC
Created attachment 367834 [details] [review]
user-accounts: Render user images with CSS

We make UmUserImage a GtkBox child and use CSS to render an image
on top of it.

This patch makes the user images rounded.
Comment 33 Ondrej Holy 2018-02-05 09:09:07 UTC
Review of attachment 367819 [details] [review]:

No need to re-upload the patches, which have not changed...
Comment 34 Ondrej Holy 2018-02-05 09:09:13 UTC
Review of attachment 367820 [details] [review]:

dtto
Comment 35 Ondrej Holy 2018-02-05 09:09:18 UTC
Review of attachment 367821 [details] [review]:

Looks ok, thanks.

But still, I hit some segfaults, which seems for some reason related to this patch (I can't reproduce without this patch)... :-(

Steps to reproduce:
1/ change avatar for some user
2/ change avatar again for the SAME user
3/ change avatar for ANOTHER user

You will see the following:
(gnome-control-center:20162): GLib-GObject-CRITICAL **: 09:54:24.769: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(gnome-control-center:20162): AccountsService-CRITICAL **: 09:54:24.770: act_user_collate: assertion 'ACT_IS_USER (user2)' failed

(gnome-control-center:20162): AccountsService-CRITICAL **: 09:54:24.770: act_user_collate: assertion 'ACT_IS_USER (user2)' failed

(gnome-control-center:20162): GLib-GObject-WARNING **: 09:54:24.770: invalid uninstantiatable type '(null)' in cast to 'ActUser'

(gnome-control-center:20162): AccountsService-CRITICAL **: 09:54:24.770: act_user_get_uid: assertion 'ACT_IS_USER (user)' failed

(gnome-control-center:20162): AccountsService-CRITICAL **: 09:54:24.770: act_user_get_real_name: assertion 'ACT_IS_USER (user)' failed

(gnome-control-center:20162): AccountsService-CRITICAL **: 09:54:24.770: act_user_get_user_name: assertion 'ACT_IS_USER (user)' failed

(gnome-control-center:20162): GLib-CRITICAL **: 09:54:24.770: g_utf8_collate_key: assertion 'str != NULL' failed
Segmentation fault (core dumped)
Comment 36 Ondrej Holy 2018-02-05 09:09:23 UTC
Review of attachment 367822 [details] [review]:

See review of the following patch...
Comment 37 Ondrej Holy 2018-02-05 09:09:41 UTC
Review of attachment 367834 [details] [review]:

I did not go thru the code, because I am not still convinced that this is the right way to go. I think we should rather crop the images themselves and make their borders transparent, so they will be shown rounded in all possible places, not only in users panel (I am pretty sure I wrote this somewhere already, but can't find it right now). 

With this patch applied, the default avatar is not rendered for some reason.

And also see:

../../gnome-control-center/panels/user-accounts/um-user-image.c: In function ‘render_image’:
../../gnome-control-center/panels/user-accounts/um-user-image.c:42:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         icon_file = act_user_get_icon_file (image->priv->user);
                   ^
../../gnome-control-center/panels/user-accounts/um-user-image.c:54:75: warning: passing argument 1 of ‘gtk_widget_get_style_context’ from incompatible pointer type [-Wincompatible-pointer-types]
             gtk_style_context_add_provider (gtk_widget_get_style_context (image),
                                                                           ^~~~~
In file included from /opt/gnome/include/gtk-3.0/gtk/gtkapplication.h:27,
                 from /opt/gnome/include/gtk-3.0/gtk/gtkwindow.h:33,
                 from /opt/gnome/include/gtk-3.0/gtk/gtkdialog.h:32,
                 from /opt/gnome/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /opt/gnome/include/gtk-3.0/gtk/gtk.h:31,
                 from ../../gnome-control-center/panels/user-accounts/um-user-image.h:22,
                 from ../../gnome-control-center/panels/user-accounts/um-user-image.c:19:
/opt/gnome/include/gtk-3.0/gtk/gtkwidget.h:1311:19: note: expected ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} but argument is of type ‘UmUserImage *’ {aka ‘struct _UmUserImage *’}
 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 38 Felipe Borges 2018-02-05 12:07:32 UTC
Created attachment 367905 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 39 Felipe Borges 2018-02-05 12:08:39 UTC
Created attachment 367906 [details] [review]
user-accounts: Introduce the new Avatar Chooser popover

This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
Comment 40 Felipe Borges 2018-02-05 12:09:44 UTC
Review of attachment 367906 [details] [review]:

::: panels/user-accounts/um-photo-dialog.c
@@ +525,3 @@
                 um->user = NULL;
         }
+        um->user = g_object_ref (user);

I traced it down to a decrease of reference counting for the User object on disposal.

This should fix it now. Let me know if you still reproduce it.
Comment 41 Ondrej Holy 2018-02-05 12:54:24 UTC
Review of attachment 367906 [details] [review]:

That's it, thanks!
Comment 42 Felipe Borges 2018-02-05 12:54:36 UTC
Created attachment 367909 [details] [review]
user-accounts: Make the avatar entries rounded
Comment 43 Felipe Borges 2018-02-05 12:55:44 UTC
(In reply to Felipe Borges from comment #42)
> Created attachment 367909 [details] [review] [review]
> user-accounts: Make the avatar entries rounded

Ah, worth mentioning that this depends on a constant defined in Bug 792243.
Comment 44 Ondrej Holy 2018-02-05 14:00:36 UTC
(In reply to Felipe Borges from comment #43)
> (In reply to Felipe Borges from comment #42)
> > Created attachment 367909 [details] [review] [review] [review]
> > user-accounts: Make the avatar entries rounded
> 
> Ah, worth mentioning that this depends on a constant defined in Bug 792243.

Anyway, the latest patch fails to apply on top for me for some reason, but it still just changes the bitmap only for user panel. Sorry if it was not clear before, but I meant that we should make the bitmap circular after we choose it from whatever source (default, camera, file) and **set the cropped avatar over accountsservice**, so it will be circular on all places e.g. shell and gdm, not only in users panel...

It doesn't make sense to me to make users into believing that the avatars are circular and consequently show them something different in shell, or gdm...

(Imagine that you will take a photo and in the corner is your naked friend, you will crop it to circle and everything looks ok in Users panel, but then the naked friend is shown in the corner of your avatar on login screen... I am just kidding, but that's exactly why I don't like this change.)

However, I am not sure that e.g. gdm is ready for such change at this point. So I would push just the new set of faces and new popover without the circular shapes before freeze...

Btw that change still requires an update for crop dialog.

Please discuss the circular avatars with Allan if you think that I am wrong...
Comment 45 Felipe Borges 2018-02-05 15:08:31 UTC
(In reply to Ondrej Holy from comment #44)
> However, I am not sure that e.g. gdm is ready for such change at this point.
> So I would push just the new set of faces and new popover without the
> circular shapes before freeze...
> 
> Btw that change still requires an update for crop dialog.
> 
> Please discuss the circular avatars with Allan if you think that I am
> wrong...

Ok. To be fair lets leave the rounding discussion for the next cycle then, since it involves other components. We are too tight in the release schedule to push these changes now.

I will go forward with the popover as it is, with rectangular images.
Comment 46 Felipe Borges 2018-02-05 15:20:07 UTC
Comment on attachment 367909 [details] [review]
user-accounts: Make the avatar entries rounded

See Bug 793188.
Comment 47 Felipe Borges 2018-02-05 15:21:20 UTC
Attachment 367819 [details] pushed as 3fb1c1d - user-accounts: Turn UmPhotoDialog in a full GObject
Attachment 367820 [details] pushed as 169a0b3 - user-accounts: Introduce a UI template for UmPhotoDialog
Attachment 367906 [details] pushed as 028a06f - user-accounts: Introduce the new Avatar Chooser popover
Comment 48 Allan Day 2018-02-05 20:41:18 UTC
(In reply to Ondrej Holy from comment #44)
...
> > Ah, worth mentioning that this depends on a constant defined in Bug 792243.
> 
> Anyway, the latest patch fails to apply on top for me for some reason, but
> it still just changes the bitmap only for user panel. Sorry if it was not
> clear before, but I meant that we should make the bitmap circular after we
> choose it from whatever source (default, camera, file) and **set the cropped
> avatar over accountsservice**, so it will be circular on all places e.g.
> shell and gdm, not only in users panel...
...

I'm not entirely sure about this. It would certainly help with consistency, but:

 1. A square border is often placed around avatar images. We ought to check whether how round images will look.
 2. What if an app wants to show a square image for some reason? Is it right for us to enforce the shape of the avatar image?
 3. What happens if we decide that we no longer want round images in the future?
Comment 49 Ondrej Holy 2018-02-09 12:38:40 UTC
The avatar chooser mockup looks great, but do you think that is ok to show circle and save rectangle (i.e. include something that is not visible)? I agree with showing just circular images in the user's panel (in the carousel and next to the name) even though that source images are squares. But if square images will be saved in accountsservice, then it should be obvious, at least from the avatar chooser (and when cropping), that the images are squares and not circles... that's my two cents.