Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserCard: Handle click event using Gtk.GestureMultiPress #680

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/greeter.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<issues>
<issue url="https://github.com/elementary/greeter/issues/25">Mask corners</issue>
<issue url="https://github.com/elementary/greeter/issues/70">User mouse settings aren't applied</issue>
<issue url="https://github.com/elementary/greeter/issues/295">Clicking in the card but outside of the wallpaper window does not switch the card</issue>
<issue url="https://github.com/elementary/greeter/issues/451">Reuse mouse settings if only one user exists</issue>
<issue url="https://github.com/elementary/greeter/issues/541">Some shortcuts to switch keyboard layout does not work on lockscreen</issue>
<issue url="https://github.com/elementary/greeter/issues/610">Screen reader shortcut doesn't launch</issue>
Expand Down
6 changes: 3 additions & 3 deletions src/Cards/UserCard.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Greeter.UserCard : Greeter.BaseCard {
private Pantheon.AccountsService greeter_act;
private Pantheon.SettingsDaemon.AccountsService settings_act;

private Gtk.GestureMultiPress click_gesture;
private Gtk.Revealer form_revealer;
private Gtk.Stack login_stack;
private Greeter.PasswordEntry password_entry;
Expand Down Expand Up @@ -249,13 +250,12 @@ public class Greeter.UserCard : Greeter.BaseCard {
return false;
});

card_overlay.button_release_event.connect ((event) => {
click_gesture = new Gtk.GestureMultiPress (this);
click_gesture.pressed.connect ((n_press, x, y) => {
if (!show_input) {
focus_requested ();
password_entry.grab_focus ();
}

return false;
});

// This makes all the animations synchonous
Expand Down