Commit graph

330 commits

Author SHA1 Message Date
Maximilian Seidler
64ad702b26
input-field: fix placeholder not updating correctly (#995)
Bug introduced in #959, reference made the config text be overwritten
2026-04-17 14:08:58 +00:00
Maximilian Seidler
78c1d26da7
core: don't register dmabuf when screencopy is not required (#992) 2026-04-17 13:45:14 +00:00
Maximilian Seidler
a466de1431
core: eglReleaseThread when no outputs and egl error logging (#994)
* core: eglReleaseThread when we have no outputs

This fixes monitor on/off on the somewhat broken nvidia 580 drivers
and potentially other nvidia drivers as well.

* lockSurface: discard frameCallback when eglSwapBuffers fails

* egl: log more errors
2026-04-17 13:34:18 +00:00
Maximilian Seidler
34532cbd80 animation: copy active animations for save iteration 2026-04-15 09:51:34 +02:00
Maximilian Seidler
ca2aa5e5e3
lock-surface: improved handling of egl window and surface creation (#988)
* fix: handle EGL surface creation failure gracefully instead of aborting

When GPU VRAM is exhausted, eglCreatePlatformWindowSurfaceEXT and
wl_egl_window_create can return null. Previously this triggered
RASSERT -> std::abort(), crashing hyprlock and leaving the session
in a broken lock state.

Replace RASSERT with error logging and early return, setting
readyForFrame = false so the next configure event retries the
allocation. This allows hyprlock to survive transient GPU memory
pressure rather than crashing.

Fixes: https://github.com/hyprwm/hyprlock/issues/986

* lock-surface: improve error handling for lock surface configure

---------

Co-authored-by: Nilesh <nilesh@cloudgeni.us>
2026-04-13 05:04:24 +00:00
Hugo Cartigny
24c66d1be8
input-field: allow smaller dots_size (#938)
Fixes #937
2026-03-31 15:03:43 +00:00
Maximilian Seidler
4e4f03cc1d
core: use Hyprutils::CLI (#977)
* core: use Hyprutils::CLI::CLogger

* core: use Hyprutils::CLI::CArgumentParser and validate config exists
2026-03-31 14:56:08 +00:00
Maximilian Seidler
9f9ee0c2f0
label: fix alpha rendering (#979)
Fixes #975
2026-03-28 16:00:39 +00:00
Maximilian Seidler
d6c02b49e6
label: fix sigusr2 update when reload time is 0 (#978)
Fixes #976
2026-03-28 15:50:10 +00:00
rain
e1dca578ed
input-field: add check_text option (#959) 2026-03-28 15:17:33 +00:00
Maximilian Seidler
768ade88a8
pam: get username once (#974)
* pam: fix username race by using getpwuid_r instead of getpwuid

getpwuid() returns a pointer into a static buffer shared across all
threads. Any getpw*/getpwent call from another thread — including
those made internally by PAM modules during authentication — will
overwrite it before pam_start() reads pw_name, causing hyprlock to
authenticate as a random system user (root, bin, systemd-network)
or fail with 'user unknown'.

Replace with getpwuid_r(), which writes into a caller-supplied buffer,
and copy pw_name into a std::string before calling pam_start().

* pam: get username once

Instead of retrieving the username via getpwuid_r as in a69f526c95,
get the username once when initializing CPam and save it in a string.
This should be sufficent for making sure there are no problems with the
static buffer returned by getpwuid and is simpler.

* misc: clang-format

---------

Co-authored-by: mcgi5sr2 <mcgi5sr2@gmail.com>
2026-03-23 16:21:13 +00:00
nikitax44
5ba5ff5b94
background: run reload_cmd in configure if path is empty (#950) 2026-02-20 16:49:58 +00:00
Sjoerd Siebinga
b3a1076c03
core: fix use-after-free segfault in async resource widget callbacks (#961)
Properly lock AWP<IWidget> weak pointers before calling onAssetUpdate()
to prevent use-after-free when widgets are destroyed during shutdown or
output removal. Guard timer callback against null g_asyncResourceManager.
Fix destruction order to join threads before resetting globals.
2026-02-20 13:46:42 +00:00
William Escande
d099f87d36
pam: prevent nullpointer crash when user passwd isn't found (#928) 2025-12-19 15:53:53 +00:00
Maximilian Seidler
e2da7c6b1f
animation: migrate PHLANIMVAR from SP to UP (#920)
* animation: migrate PHLANIMVAR from SP to UP

* use create2

* bump hyprutils and flake update
2025-12-10 09:15:39 +00:00
Nathan.Woodburn/
98b86752fe
background: reload screenshot if reload_cmd specified (#903) 2025-10-28 18:20:34 +00:00
Maximilian Seidler
de2cc5bd54
core: migrate to Hyprutils::CAsyncResourceGatherer and improve resource handling (#879)
* core: use Hyprgraphics::CAsyncResourceGatherer

* core: move screencopy frame generation to the new resource manager

* core: introduce a dedicated onAssetUpdate callback

* check for unloaded before finished and some cleanup

* also allow for dynamic label resource deduplication

use a simple counter instead of a timestamp to allow the same
widget on a different monitor to reuse a text cmd resource.

I didn't do this before, because I was worried about two labels that use
the same command with different reload times. I mitigated that by just
incrementing the revision by the time interval. This should be sufficent
to avoid clashes.

* don't render within onAssetUpdate to avoid duplicate renders

another much improvement for multi monitor setups.
allows updating within the same frame for most labels.

* remove nvidia workaround :)

I tested and it seems like the resource manager revision makes
the nvidia workaround obsolete.
2025-10-08 08:45:09 +00:00
Maximilian Seidler
3cb799b184
core: nvidia workaround destroy renderer before EGL (#884) 2025-10-03 11:58:38 +00:00
Maximilian Seidler
7f769fa993 Revert "background: unload screenshots when monitor is removed"
Pushed to the wrong remote :(
This reverts commit 1380ca04ae.
2025-09-17 17:54:49 +02:00
Maximilian Seidler
1380ca04ae background: unload screenshots when monitor is removed
This is just for testing as of now. No merging.
2025-09-17 17:51:34 +02:00
Maximilian Seidler
61b36c64a8
renderer: fix nvidia workaround (#878) 2025-09-17 15:51:17 +00:00
davc0n
a7f2634a9e
Refactor asset management to use shared_ptr (#870)
* Refactor asset management to use shared_ptr

* Replace shared_ptr with ASP for SPreloadedAsset usage
2025-09-15 18:14:34 +00:00
Maximilian Seidler
450ae1e5f0
lock-surface: remove redundant sendDestroy calls (#868)
They are already part of the generated protocol code.
2025-09-10 16:11:06 +00:00
Maximilian Seidler
04cfdc4e5b
core: recreate rendering context when monitors are empty on nvidia (#845)
This is a workaround for nvidia that can hopefully be removed at some point.
2025-09-04 07:04:54 +00:00
Maximilian Seidler
cedbb24472
renderer: move asyncResourceGatherer out of the renderer (#863)
* lockSurface: cleanup some resources

* renderer: move asyncResourceGatherer out of CRenderer

In preperation to recreate the rendering context.
2025-09-03 09:32:12 +00:00
Maximilian Seidler
8d0e56998e
core: remove dmabuf listeners after we are done with Screencopy (#858) 2025-08-27 14:40:51 +00:00
Maximilian Seidler
a356bf055b
background: monitor transforms fixups (#859) 2025-08-27 09:32:57 +00:00
Ben Leynen
71691634e4
Add ctrl+a as binding to clear password (#832) 2025-07-29 15:07:45 +02:00
Maximilian Seidler
1e5e62d6e3
background: fix mismatched asset sizes and transforms (#830) 2025-07-25 18:39:56 +02:00
Maximilian Seidler
d993bdc105
asyncResourceGatherer: fix conditions for skipping screencopy (#829) 2025-07-22 18:12:05 +02:00
Maximilian Seidler
8ebcee2969
seat: restore cursor shape to default (#820) 2025-07-21 21:19:01 +02:00
Maximilian Seidler
1553dd78fc
core: limit onClick to down events (#826) 2025-07-20 09:46:49 +02:00
Maximilian Seidler
17fefce86e
input-field: fix wrong placeholder text for resourceID (#819) 2025-07-11 09:25:42 +02:00
lysolaka
46498da4a0
widgets: remove the libc++ version check (#818)
see https://github.com/hyprwm/hyprlock/issues/816
2025-07-11 09:25:16 +02:00
Maximilian Seidler
d84b44e695
core: use hyprutils atomic pointers (#808)
* widgets: move references to hyprutils atomic shared

* core: move std::shared_pointers to hyprutils atomic shared pointers

* Nix: bump hyprutils input

* clang-format

* cmake: bump hyprutils to v0.8.0

* and bump nix again
2025-06-28 11:01:28 +02:00
davc0n
7999f448d7
core: replace grace option with --grace cli argument (#802)
* core: replace grace option with --grace cli argument

* core: remove --immediate option

not necessary anymore, grace is not a configuration option

* Revert "core: remove --immediate option"

This reverts commit 0c99899157.

* core: add --immediate and grace option deprecation warnings

* core: review fixes for --immediate and --grace

* core: review fixes for grace deprecation
2025-06-26 09:35:25 +02:00
Maximilian Seidler
a9638986c3
core: use a screenshot for fade in/out (#726) 2025-06-22 09:24:39 +02:00
ojafuenf
8455fc8ca6
core: interpret touch as click (#788) 2025-06-04 08:14:11 +02:00
Maximilian Seidler
da1d076d84
core: fix variable substitution for LAYOUT (#778) 2025-05-19 06:23:50 +00:00
nyx
c12cf8e509
core: disable fade in when using --immediate (#763) 2025-05-07 07:13:41 +00:00
Virt
0c5fd97d61
renderer: properly treat monitor desc: prefix (#765) 2025-05-07 07:12:58 +00:00
Maximilian Seidler
fae1c4f6fe
misc: readme cleanup, remove deps required by hyprgraphics (#762) 2025-05-05 23:45:32 +02:00
Maximilian Seidler
e3bd47e177
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
Maximilian Seidler
0e3e7206bc
core: use enqueueUnlock for unlocks via SIGUSR1 (#756) 2025-04-30 07:12:40 +00:00
Maximilian Seidler
867a71dd78
core: avoid calling wl_display_read_events after poll returned due to EINTR (#757) 2025-04-30 06:11:57 +00:00
Maximilian Seidler
82808290d9
core: correct $LAYOUT replacement (#755)
* core: remove fake declaration in header

* widgets: fix layout rendering

* core: remove CSeatManager::getActiveKbLayoutName

---------

Co-authored-by: Heorhi Valakhanovich <code@mail.geov.name>
2025-04-25 13:01:34 +00:00
Maximilian Seidler
656704aeb0
config: default to center for label halign and valign (#748) 2025-04-15 09:05:42 +00:00
Maximilian Seidler
d953296227
renderer: fix gradient copy size in renderBorder (#742) 2025-04-12 11:47:53 +00:00
Maximilian Seidler
71d35aa75f
image: remove left over raw pointer to COutput (#735) 2025-04-10 07:36:54 +00:00
Maximilian Seidler
a8de918cc4
auth: use static for getValue (#732) 2025-04-08 16:37:13 +02:00