aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Lefebvre <clement.lefebvre@linuxmint.com>2023-01-17 15:54:28 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-06 12:08:33 +0100
commitc5f16ead014454267163f4a8a65f8178fc7369c9 (patch)
tree2ba39fb798851022a66738ffd2d58f4ba25f79bb
parent2a13e8411b82d08a614b183470ac1d09b84cccf5 (diff)
downloadarctica-greeter-c5f16ead014454267163f4a8a65f8178fc7369c9.tar.gz
arctica-greeter-c5f16ead014454267163f4a8a65f8178fc7369c9.tar.bz2
arctica-greeter-c5f16ead014454267163f4a8a65f8178fc7369c9.zip
user-list: Allow hidden user visibility to be toggled.
Ported from Slick Greeter by Mike Gabriel. https://github.com/linuxmint/slick-greeter/commit/ce8704c02498fef137908e36b315d0876300d2c2
-rw-r--r--src/main-window.vala21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main-window.vala b/src/main-window.vala
index 614014d..5dd5a9a 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -363,19 +363,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) {