Commit graph

166 commits

Author SHA1 Message Date
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
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
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
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
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
1651b02cc1 core: update renderer on late scale changes
ref https://github.com/hyprwm/Hyprland/issues/5842, in case a compositor sends the scale after configure
2024-05-02 15:17:04 +01:00
Daniel Mensinger
415262065f
core: Add support for JPEG and WEBP background images (#286)
* Add KDevelop files to the .gitignore

* Add support for JPEG and WEBP background images

Most of the code is copy-pasted from hyprpaper

* Try doing nix stuff

* Do not use brackets for short ifs
2024-04-24 18:06:14 +01:00
8658386f21 image: fix build with libc++
fixes #289
2024-04-22 10:12:42 +01:00
André Silva
307e473759
core: fix initialization issues in LockSurface (#285)
* LockSurface: handle uninitialized eglWindow in destructor

* LockSurface: don't render before configuration
2024-04-19 19:48:11 +01:00
bvr-yr
04267a5f83
label: add text_align option for multi-line text (#278) 2024-04-13 14:38:06 +01:00
Maximilian Seidler
6fa65e1172
input-field: increase default fade_timeout (#276) 2024-04-11 19:57:46 +01:00
Maximilian Seidler
883fbdfe01
auth: implement a full pam conversation (#205)
* auth: implement a full pam conversation

* input-field: fixup failedAttempts and color change

Credits to @bvr-yr

* pam: set default module to hyprland

* input-field: backup previous asset

* auth: restart auth in onPasswordCheckTimer

* auth: immediately switch to waiting when input was submitted

* auth: remove redundant waitingForPamAuth

* auth: add inputRequested and reschedule submitInput

* auth: clear password buffer and handle submitInput before input is requested

* Revert "input-field: backup previous asset"

This reverts commit 89702945be6af4aa43f54688ad34a4ccba994a3e.

Without the backup we avoid rendering the prompt placeholder for one frame when the failText is not available.
Looks better this way.

* auth: fallback to su if pam_module not in /etc/pam.d

rare occasion where a path check even works on nix

* auth: rename inputSubmitted and resubmit callback

* auth: detach failText from the conversation

* fix rebase mistake

* auth: make sure prompt and failText are not reset when restarting auth

needed for labels

* auth: force update timers when the prompt changes

* auth: remove unused stuff
2024-04-10 22:41:31 +01:00
bvr-yr
eb1123fa2e
widgets: add Shape + minor image improve (#266)
* widgets: add Shape

* image: minor improvment

* glClear on FB alloc

* add Nix HM

* always create FB if not xray
2024-04-10 17:24:17 +01:00
Maximilian Seidler
d9f6441254
core: use --immediate for attemptRestoreOnDeath (#270) 2024-04-10 11:28:24 +01:00
Maximilian Seidler
1bfe32e7fa
input-field: also fade in when checkWaiting is true (#265) 2024-04-09 11:14:25 +01:00
Maximilian Seidler
a50db6d56d
core: avoid double unlocks with no_fade_out (#257) 2024-04-09 11:14:04 +01:00
bvr-yr
bbbb960e42
image: add reload options (#247)
* image: add reload options

* check for actual file changes

* use modtime

* check only same paths

* add Nix HM
2024-04-07 18:09:25 +01:00
Mike Rivnak
ad41b31135
core: Add user description variable (#248) 2024-03-31 02:06:11 +01:00
bvr-yr
84c6282d6a
widgets: add rotate option to label and image (#234)
* widgets: add `rotate` option to label and image

* use framebuffer for image
2024-03-29 19:01:11 +00:00
Maximilian Seidler
6acb7552a3
label: destroy texture (#230)
* label: destroy texture

* misc: gitignore
2024-03-26 00:37:36 +00:00
Noah GITsham
87fce7923f
core: Make Ctrl+u clear password input (#226)
* Make Ctrl+u clear password input

* Fix inconsistent indentation

* Make Ctrl+Backspace clear password input
2024-03-24 20:43:32 +00:00
bvr-yr
2448774de3
config: allow mon description for monitor value (#216)
* config: allow mon description for `monitor` value

* rename field
2024-03-23 21:06:54 +00:00
YoussefAswad
230f8aadb5
config: add option to ignore empty input (#218) 2024-03-23 15:02:03 +00:00
bvr-yr
f77e17e4d2
label: add $LAYOUT variable (#211)
* label: add `$LAYOUT` variable

* add exclamation mark as wildcard to hide layout
2024-03-21 15:19:12 +00:00
kcirick
54da0cae0f
auth: Use getpwuid(getuid()) instead of getlogin() (#204)
* Making changes

* Replacing struct with auto keyword

* Removing the extra semicolon

* ran clang-format
2024-03-19 15:50:23 +00:00
Maximilian Seidler
b50acfaf94
input-field: only render the current output on fade out callback (#206) 2024-03-19 02:49:12 +00:00
bvr-yr
1bf6ffdbe2
input-field: new color features (#201)
* input-field: new color features

* add nix HM

* add workaround for faillasset not being shown on empty imput

* comment

* change cfg option name

* remove TODO

* small fix

* one more edge check

* dedup changeColor function

* simplify more
2024-03-19 02:46:52 +00:00
bvr-yr
1356f113cc
config: add -c, --config commandline options (#202)
* config: add -c, --config commandline options

* argc

* don't allow missing custom config file
2024-03-18 15:04:39 +00:00
Staz Modrzynski
2ae79757d5
core: Add missing destructors causing segfaults (#199)
Co-authored-by: Staz M <staz@staz.io>
2024-03-17 15:44:37 +00:00
bvr-yr
23224d40e4
input-field: various fixes (#198)
* input-field: some fixes

* simplify; correctly check passlen(utf8) in draw return

* correctly erase utf-8 on backspace

* render on up events too

* omglul

me dumb

* revert fade speed change
2024-03-17 00:32:43 +00:00
bvr-yr
3e38762e84
widgets: add Image (#191) 2024-03-16 16:44:44 +02:00
Maximilian Seidler
7ee406bf9b
core: fade out improvements (#194)
* core: allow fade out for grace unlock

* core: disable input once fade out started

* core: render when fade out started

* core: allow fade out for other compositors

Works fine in sway altough it fades to a black screen not to the desktop.
Still looks kinda good.

* Revert "core: allow fade out for other compositors"

This reverts commit adfeb543ad.

* misc: rename lock and unlock functions
2024-03-15 18:49:07 +00:00
Maximilian Seidler
e040c56ad2
core: fix libc++ compatibility (#195)
* core: add missing header

libc++ compatibility #193

* input-field: fix wrong clock type
2024-03-15 14:43:29 +00:00
Abhinav Anil
56e7bc1e51
input-field: fix missing fail_text when placeholder_text is empty (#192)
* input-field: fix missing fail text when placeholder is empty

* comments
2024-03-15 14:26:02 +00:00
Abhinav Anil
1c92c6109c
renderer: add fade out animation and property to disable (#188)
* renderer, Nix/HM module: add fade out animation and prop

* fix: fade duration and disable on non hyprland session

* fix: revert needsFrame condition, update duration to 500ms

* fix: make shadows obey widget opacity
2024-03-14 13:23:41 +00:00