Skip to content

Commit

Permalink
user-list: Allow hidden user visibility to be toggled
Browse files Browse the repository at this point in the history
Make it clearer how the feature works in the README.

Fixes linuxmint#83
  • Loading branch information
clefebvre committed Jan 17, 2023
1 parent 1fb20ba commit ce8704c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Configuration file format for /etc/lightdm/slick-greeter.conf
# high-contrast=Whether to use a high contrast theme (true or false)
# screen-reader=Whether to enable the screen reader (true or false)
# play-ready-sound=A sound file to play when the greeter is ready
# hidden-users=List of usernames that are hidden until a special key combination is hit
# hidden-users=List of usernames (separated by semicolons) that are hidden until Ctr+Alt+Shift is pressed
# group-filter=List of groups that users must be part of to be shown (empty list shows all users)
# enable-hidpi=Whether to enable HiDPI support (on/off/auto)
# only-on-monitor=Sets the monitor on which to show the login window, -1 means "follow the mouse"
Expand Down
21 changes: 9 additions & 12 deletions src/main-window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,16 @@ public class MainWindow : Gtk.Window
if (stack.top () is UserList)
{
var user_list = stack.top () as UserList;
if (!user_list.show_hidden_users)
var shift_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK;
var control_mask = Gdk.ModifierType.SHIFT_MASK | Gdk.ModifierType.MOD1_MASK;
var alt_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK;
if (((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) && (event.state & shift_mask) == shift_mask) ||
((event.keyval == Gdk.Key.Control_L || event.keyval == Gdk.Key.Control_R) && (event.state & control_mask) == control_mask) ||
((event.keyval == Gdk.Key.Alt_L || event.keyval == Gdk.Key.Alt_R) && (event.state & alt_mask) == alt_mask))
{
var shift_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK;
var control_mask = Gdk.ModifierType.SHIFT_MASK | Gdk.ModifierType.MOD1_MASK;
var alt_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK;
if (((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) && (event.state & shift_mask) == shift_mask) ||
((event.keyval == Gdk.Key.Control_L || event.keyval == Gdk.Key.Control_R) && (event.state & control_mask) == control_mask) ||
((event.keyval == Gdk.Key.Alt_L || event.keyval == Gdk.Key.Alt_R) && (event.state & alt_mask) == alt_mask))
{
debug ("Hidden user key combination detected");
user_list.show_hidden_users = true;
return true;
}
debug ("Hidden user key combination detected");
user_list.show_hidden_users = ! user_list.show_hidden_users;
return true;
}
}
else if (stack.top () is SessionList) {
Expand Down

0 comments on commit ce8704c

Please sign in to comment.