Skip to content

Add submit_on_click to trigger unlock from pointer/touch #997

Description

@J-Melon

Problem

hyprlock requires a physical Return keypress to submit the password. There is no pointer or touch path to submit.

Submission goes through g_pAuth->submitInput(passBuffer), currently only reached from the XKB_KEY_Return / XKB_KEY_KP_Enter branch in src/core/hyprlock.cpp.

Current workaround is synthesising Return via ydotool, which needs uinput and ydotoold.

Proposed shape

A boolean submit_on_click on the clickable widgets (label, image, shape) that already carry onclick from #736. When the widget is clicked and the option is set, hyprlock calls submitInput on the current buffer.

shape {
    size = 200, 60
    position = 0, -100
    halign = center
    valign = center
    submit_on_click = true
}

Parallels fade_on_empty, ignore_empty_input etc. for naming.

Semantics

  • Honours general:ignore_empty_input identically to the Return branch.
  • Must gate on g_pAuth->checkWaiting() to match the existing guard at src/core/hyprlock.cpp:617, which short-circuits the Return path while PAM is mid-check. The widget click path has no such guard today, so rapid clicking would otherwise queue concurrent submitInput calls.
  • If both onclick and submit_on_click are set on the same widget, the shell command is spawned asynchronously and submitInput is called in the same handler; order between the async spawn and the PAM call is not observable.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions