hyprlock/src/defines.hpp
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

21 lines
481 B
C++

#pragma once
#include <hyprutils/memory/WeakPtr.hpp>
#include <hyprutils/memory/UniquePtr.hpp>
#include <hyprutils/memory/Atomic.hpp>
#include <hyprgraphics/color/Color.hpp>
using namespace Hyprutils::Memory;
using namespace Hyprgraphics;
using ResourceID = size_t;
#define SP CSharedPointer
#define WP CWeakPointer
#define UP CUniquePointer
#define ASP CAtomicSharedPointer
#define AWP CAtomicWeakPointer
typedef int64_t OUTPUTID;
constexpr OUTPUTID OUTPUT_INVALID = -1;