Commit graph

254 commits

Author SHA1 Message Date
The-Emperor10
264fb8b70f
config: add input-field dots_fade_time option (#508)
* config: add input-field dots_fade_time option
Time is in milliseconds. Anything <= 0 is immediate.

* input-field: change speedPerSecond to fadeMs
Default is 200ms, which is the same amount of time as the previous
5 speedPerSecond. Not sure using doubles is necessary, but I'm
using them to avoid precision issues.

Closes: https://github.com/hyprwm/hyprlock/issues/355
2024-10-10 22:20:14 +01:00
Maximilian Seidler
eb63207ef0
core: make attemptRestoreOnDeath faster and hyprland exclusive (#506)
* core: make attemptRestoreOnDeath hyprland exclusive

* core: destoy lock and sessionLockSurfaces in attemptRestoreOnDeath
2024-10-05 14:30:19 +01:00
davc0n
d9c2a5e0b7
widgets: add 12h time format (#500) 2024-09-30 12:22:24 +01:00
Maximilian Seidler
9ea804788c
core: set capslock and numlock states on startup (#496) 2024-09-25 09:56:20 +01:00
Yang, Ying-chao
153977aab3
asyncResourceGatherer: stop worker threads when application is going to exit (#481) 2024-09-05 12:27:43 +01:00
Yang, Ying-chao
0b030d33c8
asyncResourceGatherer: do not detach worker threads (#477)
Worker threads become non-joinable once they are detached, and `await()` will not wait for them to
finish. This can lead to a crash when `asyncResourceGatherer` is destroyed in the main thread while it
is still being used in worker threads.
2024-09-04 20:58:38 +01:00
André Silva
73b0fc26c0 nix: add wayland-scanner native build input 2024-09-01 18:19:54 +03:00
Darko Nikolić
cc71c0b7d9
core: fix symlinked images not picking up extension (#473) 2024-08-31 12:37:47 +02:00
Maximilian Seidler
9c1e9e7db2
core: support desc: prefix for widget monitor options (#470) 2024-08-29 12:36:07 +02:00
Maximilian Seidler
a0af542f9b
input-field: refactor updateColors and other improvements (#469)
* input-field: refactor updateColors

* input-field: fix input-field:invert_numlock

* input-field: use updatePlaceholder to request the initial placeholder asset

* input-field: allow more gradual color animations

* input-field: fix caps and num indicator colors, when borderless and swap_font_color is true
2024-08-29 09:53:00 +02:00
Yang, Ying-chao
7bb4113a7e
core: fix crash caused by exiting without joining running thread (#464) 2024-08-21 11:25:14 +01:00
Maximilian Seidler
f673759d01
lockSurface: fix dynamic output mode and scale updates (#462)
* lockSurface: reload widgets on output change

* lockSurface: only configure when scale actually changed

* lockSurface: enable fsv1 per default for all compositors
2024-08-18 08:19:56 +01:00
Maximilian Seidler
9393a3e94d
core: add fractional_scaling option (#456)
* config: add fractional_scaling option

0 -> off
1 -> on
2 -> auto

* core: default auto option for fractional_scaling

* locksurface: fallback to integer scaling
2024-08-05 20:22:01 +02:00
alba4k
8cffe0618c fix alignment in help message 2024-08-04 12:53:43 +03:00
Aaron Blasko
5d85ea03b0
renderer: add --no-fade-in (#453) 2024-08-03 17:34:54 +02:00
c7fa5026c0
assets: add example.conf 2024-08-02 21:39:54 +03:00
Maximilian Seidler
8a89181e69
auth: use pam_faillock log as $FAIL (#447)
Allows us to show "(x minutes left to unlock)" directly in the
input-field fail text.
2024-07-30 18:52:50 +02:00
davc0n
5e8f12c2d9
core: minor refactor of command line options parsing (#441) 2024-07-28 19:10:36 +01:00
Maximilian Seidler
cf0e975fed
widgets: move asset updates out of the draw function (#442)
* label: move asset updates out of the draw function

This allows us to check if the label has actually updated after the
callback from the asyncResourceGatherer. If it isn't we can requeue the
renderUpdate() function.

* image: move asset updates out of the draw function
2024-07-24 23:18:11 +02:00
Maximilian Seidler
3e71799b30
misc: add issue templates (#440)
* misc: add issue templates

Copied from Hyprland and slightly modified

* misc: but template --version and minor improvements

* misc: fix bug template closing tag
2024-07-24 17:52:15 +02:00
58e1a4a499 core: add --version 2024-07-24 13:58:59 +02:00
dba9d8b517 version: bump to 0.4.1 2024-07-21 14:00:28 +02:00
Maximilian Seidler
3d3b52e42c
asyncResourceGatherer: deduplicate image rendering code (#433)
* asyncResourceGatherer: deduplicate image rendering code

Also happens to add support for JPEG and WEBP for image widgets

* asyncResourceGatherer: use a reference for path in getFileType
2024-07-19 23:20:31 +02:00
Maximilian Seidler
20c01d91d4
core: make sure m_sLockState.lock is present in onLockFinished and releaseSessionLock (#432) 2024-07-19 17:26:38 +02:00
372a4cd55e
flake.lock: update 2024-07-18 20:46:51 +03:00
a29012cbbd
CMake: fmt 2024-07-18 20:46:31 +03:00
cac93f67e8
CMake, Nix: add VERSION file 2024-07-18 20:45:42 +03:00
Maximilian Seidler
9514925a7c
core: grace unlock improvements and auth fixes for grace/SIGUSR1 unlocks (#424)
* core: check m_bTerminate for grace unlocks

* core: remove reference to the lock object on finished

* core: add isUnlocked

true if m_bFadeStarted or m_bTerminate

* auth: return early on grace or SIGUSR1 unlocks
2024-07-17 15:22:42 +02:00
a3d8a2c128
Config: use hyprutils helper (#422)
* flake.lock: update

* gitignore: add CMake residual files

* config: use hyprutils helper

* CMake: update required hyprutils version
2024-07-16 22:35:48 +02:00
Maximilian Seidler
69d37d2663
core: immediately create session lock surfaces (#421)
* core: immediately create session lock surfaces

Instead of waiting for the `locked` event, create session lock surfaces
right away.

* core: don't allow unlock_and_destroy if `locked` has never been recieved
2024-07-14 16:59:06 +02:00
Maximilian Seidler
b407128cae
core: handle ext_session_lock_v1::finished as defined in the protocol (#418) 2024-07-11 16:15:32 +02:00
Maximilian Seidler
e5f0b56d07
asyncResourceGatherer: trace logs and exit behaviour (#414)
* asyncResourceGatherer: add trace logs

useful for debugging label updates

* label: remove unused onAssetCallbackTimer

* asyncResourceGatherer: fix crashes on exit
2024-07-10 12:05:18 +02:00
davc0n
944caff79f
config: add input-field fail_timeout option (#406)
* config: add input-field fail_timeout option

* config: change input-field fail_timeout to milliseconds

* input-field: fix configFailTimeoutMs type and init
2024-07-09 17:43:31 +02:00
Jasson
d8ccc6f96a
core: Label exception handling + Frambuffer checks + headers (#413)
* Added exception handling in label constructor

* Framebuffer fix + moved headers

* added optional header
2024-07-09 11:32:49 +02:00
Maximilian Seidler
3bedae4436
auth: don't start pam conversation before the initial input happens (#409)
After realizing that pam modules sometimes implement a timeout, i think
it is not worth starting the convo it right away.
Now you won't get the initial PAM_PROMPT any more.
Prompt will be initialized to "Password: ", which is most commonly what
you get from pam. Subsequent prompts (e.g. 2fa) will be handled however.
2024-07-08 14:25:06 +02:00
Davide Conti
e72f601209 readme: add official repo package to arch install 2024-07-08 14:15:10 +03:00
Maximilian Seidler
43f2b7441b
core: handle missing wayland protocol support (#408)
* core: check support of wp_factional_scale_manager_v1 and wp_viewporter

* core: check support of zwlr_screencopy_manager_v1
2024-07-07 21:44:53 +02:00
Maximilian Seidler
0552a1eddd
core: add option to render solid background immediatly when bg assets are not ready (#407)
* asyncResourceGatherer: start the asyncLoop at the same time as gather

This is a prerequesit for labels beeing drawn, while backgrounds are
note ready yet.

* core: allow immediate rendering even when backgrounds are not gathered yet

Note:
We don't really need to call `asyncResourceGatherer::apply` in the
`renderLock` function, since it will get called by a call to
`asyncResourceGatherer::getAssetById` anyways.

* background: render color rectangle when asset is not ready yet

* config: add general:immediate_render config option

* core: use the --immediate-render flag in attemptRestoreOnDeath
2024-07-07 18:43:17 +02:00
Jasson
a50296c181
core: minor bugfixes (#405) 2024-07-07 17:55:59 +02:00
Tom Englund
7fb3c03500
hyprlock: ensure members are accessed direct (#404)
if the unique_ptr is reset directly accessing it from the destructor
causes crashes on Clang/libc++, just access the members directly.
2024-07-06 12:24:29 +02:00
daywalker-dev
6e0921140e
helpers: fix jpeg and webp OOM error (#401)
* Update Jpeg.cpp

* Update Webp.cpp
2024-07-05 22:58:45 +02:00
29420ddb6c cmake: bump ver to 0.4.0 2024-07-05 22:55:15 +02:00
Maximilian Seidler
b862bbce71
auth: pam fallback log message and always call pam_end after pam_authenticate (#399)
* auth: make the fallback to sudo error more descriptive

* auth: always call pam_end after pam_authenticate
2024-07-05 22:54:40 +02:00
Maximilian Seidler
01bf48ed96
config: don't crash when getenv HOME returns null (#398) 2024-07-05 22:41:03 +02:00
Maximilian Seidler
9737bf6484
label: do not error when using cmd[] for a static label cmd (#396) 2024-07-04 18:04:45 +02:00
davc0n
5b19c6307a
config: Remove dupe input-field rounding from listKeysForSpecialCategory (#395) 2024-07-03 23:50:07 +02:00
Maximilian Seidler
9873ec58b7
asyncResourceGatherer: add dma frames before starting the asyncLoopThread (#394) 2024-07-03 19:31:16 +02:00
Maximilian Seidler
88b9ce48ed
core: improve dynamic output handling (#386)
* core: check for sessionLockSurface before calling render

This is needed, because when a new monitor is added via `onGlobal` the
order of the events is not guaranteed. Meaning that render for a
particular monitor might get called before a `CSessionLockSurface` for
that monitor exists.

* renderer: remove widgets for destroyed lockSurfaces

* asyncResourceGatherer: don't create duplicate dma frames for a specific stringPort

* core: remove renderer widgets in ~CSessionLockSurface instead of in onGlobalRemoved

* Revert "core: remove renderer widgets in ~CSessionLockSurface instead of in onGlobalRemoved"

This reverts commit 405aa42de8.

Because of destruction order, it is safer to do it in `onGlobalRemoved`.

* core: ditch dynamic DMAFrame generation

* core: identify DMAFrames via output size and stringPort

* core: fallback to background color for dynamic outputs with background:path=screenshot

* core: remove output pointer from DMAFrame
2024-07-02 00:45:06 +02:00
Maximilian Seidler
0f66aeac03
core: fix sourcing config files (#387)
* core: fix sourcing config files

The `handleSource` handle relies on `g_pConfigManager`, which therefore
needs to be moved before `init`.

* core: remove unnecessary unique pointer moves
2024-06-28 18:57:38 +02:00
Maximilian Seidler
318c00d6d0
core: stabilize label updates and revision locking in the asyncResourceGatherer (#384)
* core: handle rerendering when frameCallback is pending

* core: log when skipping label updates

* asyncResourceGatherer: remove busy and use loopMutex

Makes getAssetById fail less often and thus labels get more stable
updates

* asyncResourceGatherer: revision locking

`assetsMutex` was not needed, since `apply` only gets called from the
main thread and resources are also only aquired via the main thread.

`preloadTargets`, previously kinda guarded by the `busy` flag are now
locked as suggested in #367 (but via a copy of `peloadTargets`).

`apply` now returns a boolean so that the locking of preloadTargets in
combination with checking `preloadTargets.empty()` is a bit nicer.

* asyncResourceGatherer: remove explicit template arg for unique lock
2024-06-26 20:31:15 +02:00