Hyprland's GPU-accelerated screen locking utility
Find a file
Maximilian Seidler e3bd47e177
Some checks are pending
Build / nix (push) Waiting to run
widgets: add onclick feature (#736)
* widget: add click handling and point containment methods to IWidget interface

* core: add onClick method to handle mouse click events

- renderer: move getOrCreateWidgetsFor method declaration to public section

* core: update mouse event handling to track mouse location and button clicks

* widget: add onclick command handling and point containment to CLabel

- config: add onclick special config value to label

* assets: add label configuration for keyboard layout switching

* config: add onclick configuration for label widgets

 - add CLICKABLE macro for onclick configuration
 - replace direct onclick assignment with CLICKABLE macro

* core: fix cursor shape initialization and pointer handling

 - ensure pointer is available before setting cursor shape
 - initialize cursor shape device if not already done

* core: add hover handling and cursor shape updates

 - implement onHover method to manage widget hover states
 - update cursor shape based on hover status
 - ensure all outputs are redrawn after state changes

* widgets: add hover state management and bounding box calculations

 - add setHover and isHovered methods to manage hover state
 - implement containsPoint method for hit testing
 - override getBoundingBox in CLabel for accurate positioning
 - add onHover method in CLabel to change cursor shape

* core: add hover handling in pointer motion

 - invoke onHover method with current mouse location

* widgets: add hover handling and bounding box for password input field

 - add getBoundingBox method to calculate the widget's bounding box
 - implement onHover method to update cursor shape on hover

* widgets: update hover behavior for label widget

 - modify cursor shape setting to only apply when onclickCommand is not empty

* core: optimize hover handling and rendering for lock surfaces

 - Improve hover state tracking for widgets
 - reduce unnecessary redraw calls by tracking hover changes
 - remove redundant renderAllOutputs() call

* widgets: add onclick and hover to shape and image

* core: trigger hover and onclick only for the currently focused surface

* core: handle fractionalScale in onclick and hover

* core: don't trigger onclick or hover when hide_cursor is set

* misc: remove braces

* core: run onclick commands asnychronously

---------

Co-authored-by: Memoraike <memoraike@gmail.com>
2025-05-05 15:11:24 +00:00
.github CI: remove deprecated magic-nix-cache-action 2025-02-08 23:07:22 +02:00
assets widgets: add onclick feature (#736) 2025-05-05 15:11:24 +00:00
nix nix: mesa -> libgbm 2025-03-14 08:36:46 +02:00
pam Adding a pam configuration file (#115) 2024-03-02 01:49:44 +02:00
protocols background: add screenshot 2024-02-21 21:39:14 +00:00
src widgets: add onclick feature (#736) 2025-05-05 15:11:24 +00:00
.clang-format core: initial commit 2024-02-18 23:08:03 +00:00
.clang-tidy clang-tidy: fix some errors (#751) 2025-04-21 20:17:15 +02:00
.gitignore core: fix background screenshot on nvidia (#656) 2025-01-24 14:25:37 +01:00
CMakeLists.txt CMake: require wayland-protocols>=1.35 (#713) 2025-03-20 08:52:02 +00:00
flake.lock flake.lock: update 2025-04-17 10:18:52 +03:00
flake.nix Core: move to hyprwayland-scanner (#624) 2024-12-29 18:36:08 +00:00
LICENSE Initial commit 2024-02-18 16:10:12 +00:00
README.md Core: move to hyprwayland-scanner (#624) 2024-12-29 18:36:08 +00:00
VERSION version: bump to 0.8.2 2025-05-03 15:04:47 +01:00

hyprlock

Hyprland's simple, yet multi-threaded and GPU-accelerated screen locking utility.

Features

  • uses the secure ext-session-lock protocol
  • full support for fractional-scale
  • fully GPU accelerated
  • multi-threaded resource acquisition for no hitches

How it looks

Docs / Configuration

See the wiki

Arch install

pacman -S hyprlock # binary x86 tagged release
# or
yay -S hyprlock-git # compiles from latest source

Building

Deps

You need the following dependencies

  • wayland-client
  • wayland-protocols
  • mesa
  • hyprwayland-scanner

And the development libraries for the following

  • cairo
  • libdrm
  • pango
  • xkbcommon
  • pam
  • hyprlang
  • hyprutils
  • hyprgraphics
  • libmagic (file-devel on Fedora)

Development libraries are usually suffixed with -devel or -dev in most distro repos.

You also need to install mesa-libgbm-devel on some distros like RPM based ones where its not bundled with the mesa package.

Building

Building:

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
cmake --build ./build --config Release --target hyprlock -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`

Installation:

sudo cmake --install build