When opening the user panel we g-c-c performs lots of sync operations that
may cause a noticeable slowdown, especially when a fingerprint device is
available, in fact set_fingerprint_label() call leads to:
- DBus sync request of the system bus
- fprintd dbus-activation
+ This leads to sync opening of all the devices, that might also cause
a slowdown, depending on the devices drivers
- Dbus sync calls to the device to get the list of enrolled fingerprints
Only after we've a reply, we update the g-c-c UI and continue the execution.
The fingerprint dialog code would need some global refactor, but to fix this
without big changes, let's just use GTask that runs a thread in wich we do
all the sync operations, and once done we finally update the widget state.
The object was wrongly unreffed (as ActUserManager has the ownership) on
user switch, so add a reference instead when assigning it to our private
ref and unref it on dispose.
This patch provides an easy way to override default faces using
org.gnome.desktop.interface.avatar-directories settings configuration
that can be used in gnome-initial-setup too so downstream can override
default avatar faces without the need of a patch.
Fix https://gitlab.gnome.org/GNOME/gnome-control-center/issues/678
The add user button is shown only if the panel is unlocked, but
tooltips are also set for the case when the panel is not unlocked.
Let's move the tooltip text in the UI file directly and remove
the obsolete codes.
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
`dest_x` is not set if `gtk_widget_translate_coordinates()` fails, which
it can do before the widget is realised.
This fixes a valgrind warning, but doesn’t change any user-visible
behaviour as far as I can tell.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Changes made by GNOME/gnome-control-center!359 caused that the username
hint ("This will be used to name your home folder and can’t be changed.")
is not shown immediately after opening the "Add User" dialog. This change
was unwanted. Let's show the hint immediately after opening the dialog as
it was before.
gtk_widget_translate_coordinates() doesn't have to always set the
dest_x argument. Let's initialize the argument before use to prevent
usage of uninitialized value, which also prevents "Conditional jump
or move depends on uninitialised value(s)" messages from valgrind.
Otherwise we might potentially be using the GtkSettings for the wrong
screen, which might make a difference if one screen has animations
enabled but another doesn’t.
(This is an edge case I spotted while reading the code, but not one that
I’ve experienced practically.)
Signed-off-by: Philip Withnall <withnall@endlessm.com>
When animations are disabled, the @keyframes CSS rule doesn’t work, and
neither does animation-name — so we need to set the margin-left to the
arrow’s final location directly.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
On distro openSUSE Tumbleweed and SUSE Linux Enterprise the path
of command usermod is not in environment variable PATH, we need to
use absolute path to find command.
Access strings via pointers, which reduces copying and the chances of leaks.
Simplify cases where string arrays were modified - no need to replace the value as it's no longer allocated.
Always complete the loop so references are freed.
On Fedora 31, the "Current Password: " prompt is printed by passwd,
when I enter my current password wrongly. It is not clear to me why
and I don't know how to debug the PAM stack, but it causes that the
checkmark for the old password field is not reliable and what is worse
it causes the dialog hangs when it is submitted. Let's add check for
the "urrent" keyword to fix this issue.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/766
Currently, the password_entry_timeout() callback can be called even after
the dialog disposal, which leads to segfaults. This is because the
corresponding source ids can be cleared in some cases without removing
the sources. Let's prevent direct calls of password_entry_timeout()
without destroying the source ids in order to fix this issue.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/760
On FreeBSD, the default full name of a user is 'User &'. The '&'
character included in the name is expected to be replaced with the login
name when it is displayed on the user interface. However, it seems that
AccountsService doesn't know it. It just returns 'User &' to the caller,
and it causes the markup to be broken in the user panel.
Username policies differ across the distributions. See the discussion on:
https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/359
It is not possible to hard-code some rules here without the need for
downstream modifications. Let's check the validity of usernames dynamically
over "usermod" to prevent this.
Just be careful that this is based on undocumented usermod behavior, which
may change in the future.
We are currently adding support for Synaptics devices that require 8
steps. Add another row for images which brings us to up to 10
supportable steps for now.
setlocale() is not threadsafe except when used only to query the locale
without changing it. Let's use uselocale() instead, which changes the
locale only on the calling thread. Much better.
If "Esc" is pressed, the callbacks to handle the `focus-out` signal are
called after the `cc_password_dialog_dispose` function. This leads to
segfaults, because the `user` variable is already cleared. Let's simply
do not continue if `user == NULL` to fix those crashes.
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/563
Usually, passwd exits with an error if the current password is incorrect,
however, when using LDAP, it askes for password again. It causes hangs as
the passwd helper assumes that the password is correct. Let's prevent this
hangs using additional check for "incorrect" keyword.
Based on a patch from https://launchpad.net/bugs/607357 made by Ryan Tandy.
https://bugzilla.gnome.org/show_bug.cgi?id=786530
The `round_image()` function has the `icon_size` parameter, which is not
used by that function, because the size is determined from a pixbuf size.
Let's remove that redundant `icon_size` parameter.
accountsservice has 1 MB limit for avatars, however, users panels
refuses to show avatars bigger than 64 KB for some historical reasons.
But you can still successfully set avatars up to the accountsservice
limit. Let's remove this custom limit and other redundant check and
rely just on accountsservice limits and errors from GDK.
https://bugzilla.gnome.org/show_bug.cgi?id=792243
Default set of avatars uses 512x512 currently. However, custom avatars
from file, or webcam are always scaled down to 96x96. Let's increase this
also to 512x512. This change should be safe, because theoretical maximal
file size is 1 MB, which is equal to accountsservice limit.
https://bugzilla.gnome.org/show_bug.cgi?id=792243
In the User Accounts panel's carousel, longer real names
push the window geometry to super wide levels -- even with
the 255-char limitation in place.
Fix that by ellipsizing the real name label.
GNOME Settings allows limitless full names, which is
actually accepted by most of the stack but may break
GNOME Settings, GNOME Shell and other user-visible
applications that show the user names.
Limit the user full name entries to 255 characters,
which is the same value used by GNOME Initial Setup.
Changes from !373 causes crashes when "Add User" dialog is canceled.
Check return value and generate user avatar only if valid user is
returned to fix the crashes.