Commit graph

286 commits

Author SHA1 Message Date
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
Jasson Cordones
d31e600f14
core: Inproved error handling and arg parsing (#380)
* Inproved error handling and arg parsing

* Removed duplicated lines

* Remove curly braces from short ifs, used c-style casts, used contains instead of find to parse exception, applied clang formating

* Fix Formatting
2024-06-25 20:09:52 +02:00
Florian Walter
210b456c15
core: fix second instance of hyprlock unlocking session (#376)
* fix second instance of hyprlock unlocking session

* fix segfault when lock cannot be acquired

* improve ordering of display roundtrips
2024-06-25 13:46:58 +02:00
Vaxry
c5b8ad03d0
core: move to hyprutils for utils (#362)
* core: move to hyprutils for utils

* Nix: add hyprutils dep

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-06-08 23:49:49 +02:00
Gualberto Escalante
e07d4110dc readme: Add Arch instructions 2024-05-29 15:54:37 +03:00
André Silva
768cd3ea52
core: handle null timers in destructors (#350) 2024-05-26 18:46:53 +02:00
Tom Englund
58c93d8de8
core: fix a few reported leaks by asan (#349)
* widgets: add missing virtual destructor

destructor is missing and as a consequence all sub classes gets wrongly
destructed reported as "new-delete-type-mismatch" by asan.

* gatherer: free memory allocated by pango

with pango_parse_markup its up to the caller of the function to free the
pointer to the text returned stored in this buf.

* core: add destructor and free devices

add a destructor and free both drmDevice and gbmDevice, leaks reported
by asan.

* core: free xkb allocated state and keymap

free xkb state and keymap on destruction to prevent leak on exit and
less asan spam.

* locksurface: destroy the surface frame on done

the callback was never being destroyed and is leaking on each
frameCallback creation, call wl_callback_destroy in onCallback() and
free the memory. reported with asan.
2024-05-25 20:05:37 +02:00
972c1c27e6 restore: move to runtime dir and check his
fixes #346
2024-05-23 12:58:54 +02:00
ba4b08e5f5
nix/hm-module: remove 2024-05-21 19:45:18 +03:00
giskard
18d2d2ba6a
cmake: macro-prefix-map, compile_commands.json (#338)
* cmake: position independent build for `__FILE__`

* cmake: generate compile_commands.json, coder-friendly
2024-05-20 23:00:28 +01:00
shezdy
997f222b0f
core: add zindex option to widgets (#334)
* add zheight

* move sort to renderer

* fix format

* change name to zindex
2024-05-17 19:29:05 +01:00
Maximilian Seidler
316c37746d
core: add key repeat for backspace and make del clear the input (#277)
* core: add support for repeating backspace when held

* core: move keysym handling to a seperate function in order to reuse it for key repeat

* core: get keyboard repeat info from wayland

* core: defaults for keyboard repeat and delay
2024-05-14 16:11:45 +01:00
Daniel Horton
386a1e6fc2
readme: Fixed getconf command in build instructions (#326)
getconf NPROCESSORS_CONF isn't a valid command. The correct command is getconf _NPROCESSORS_CONF.
2024-05-13 15:21:54 +01:00
bvr-yr
0477df2ca4 gatherer: use absolute path in magic guess 2024-05-12 13:46:49 +03:00
davc0n
c87af3aa1f
renderer: add text trim with option to disable (#310)
* renderer: add text trim with option to disable

* refactor: format CAsyncResourceGatherer::renderText

* config: change disable_text_trim to text_trim
2024-05-04 18:18:27 +01:00
Antonio Cheong
21226c1206
README: add libmagic dependency (#307) 2024-05-04 00:11:56 +01:00
Yoni Firroloni
3cd461405c readme: add new line for clarity 2024-05-03 15:34:13 +03:00
992fb49f3a session-lock: use logicalSize in late configure
ooops

ref #303
2024-05-03 13:21:51 +01:00
9cca0dbb45 core: avoid sending duplicate acks for ls 2024-05-02 15:18:17 +01:00