Add VIDEO_BACKEND cmake option (default ON) that controls whether FFmpeg
is required and video playback is compiled in. When OFF, VideoBackend.cpp
is excluded from the build and all video code paths in Background are
gated by HYPRLOCK_HAS_VIDEO, allowing a no-FFmpeg build for packagers
who want to ship without the dependency.
Move FFmpeg decode thread, frame buffering, and lifecycle management
out of CBackground into a dedicated CVideoBackend class. Background.hpp
no longer includes FFmpeg headers. CBackground interacts with video
purely via open(), swapFrame(), and frameW/H().
Extend the background widget to natively decode and display video
files (mp4, mkv, webm, avi, mov, gif, and more) using FFmpeg, with
no external tools required.
- Detection is extension-based; existing image paths are unaffected
- A background decode thread paces frames to their PTS timestamps
and publishes them to the render thread via an O(1) mutex-swap,
avoiding any memcpy per frame
- sws_getCachedContext handles codecs that only report their pixel
format after the first decoded frame
- Videos loop seamlessly via av_seek_frame at EOF
- blur_passes works on video frames the same as on images
- No new config keys: path = /path/to/video.mp4 is sufficient
* 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.
* 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>
BREAKING:
- Removed `input-field:dots_fade_time`. Now configured via
`animation=inputFieldDots,...`
- Removed `input-field:fail_transition`. Now configured via
`animation=inputFieldColors,...`
- Removed `general:no_fade_in` and `general:no_fade_out`. Now configured
globally via `animations:enabled` or via `animation=fadeIn,...` and
`animation=fadeOut,...`
* image: use absolutePath to get last_write_time and ignore when no reloadTime
* background: use absolutePath to get last_write_time and ignore when no reloadTime
* misc: use Vector2D, Box and Mat3x3 from hyprutils
* nix: flake update
Fix CI fails. We need hyprutils>=0.2.3
* misc: use a function to convert Hyprlang::VEC2 to Vector2D
* misc: fixup some includes
* 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
* background: fix background not rendering when resource gatherer is busy
* asyncResourceGatherer: check cairo_surface_status
* background: clear resource id when texture is invalid