diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-06-08 10:07:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-08 10:07:59 +0200 |
| commit | 6967a31450441fc5605c05db6f65505dace4b263 (patch) | |
| tree | 255a3cff7f3e2eb8a50c952eab9b270a7937561d /src/protocols/AlphaModifier.hpp | |
| parent | c31d9ef4172452f6f219f91d9b87a24d91f0cf3a (diff) | |
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl
it's the final countdown
Diffstat (limited to 'src/protocols/AlphaModifier.hpp')
| -rw-r--r-- | src/protocols/AlphaModifier.hpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/protocols/AlphaModifier.hpp b/src/protocols/AlphaModifier.hpp index 457d1b4c..d49d1e4e 100644 --- a/src/protocols/AlphaModifier.hpp +++ b/src/protocols/AlphaModifier.hpp @@ -5,23 +5,28 @@ #include <unordered_map> #include "WaylandProtocol.hpp" #include "alpha-modifier-v1.hpp" +#include "../helpers/signal/Listener.hpp" + +class CWLSurfaceResource; class CAlphaModifier { public: - CAlphaModifier(SP<CWpAlphaModifierSurfaceV1> resource_, wlr_surface* surface); + CAlphaModifier(SP<CWpAlphaModifierSurfaceV1> resource_, SP<CWLSurfaceResource> surface); ~CAlphaModifier(); - bool good(); - wlr_surface* getSurface(); - void onSurfaceDestroy(); + bool good(); + SP<CWLSurfaceResource> getSurface(); + void onSurfaceDestroy(); private: SP<CWpAlphaModifierSurfaceV1> resource; - wlr_surface* pSurface = nullptr; + WP<CWLSurfaceResource> pSurface; void setSurfaceAlpha(float a); - DYNLISTENER(surfaceDestroy); + struct { + CHyprSignalListener destroySurface; + } listeners; }; class CAlphaModifierProtocol : public IWaylandProtocol { @@ -33,15 +38,15 @@ class CAlphaModifierProtocol : public IWaylandProtocol { private: void onManagerResourceDestroy(wl_resource* res); void destroyModifier(CAlphaModifier* decoration); - void onGetSurface(CWpAlphaModifierV1* pMgr, uint32_t id, wlr_surface* surface); + void onGetSurface(CWpAlphaModifierV1* pMgr, uint32_t id, SP<CWLSurfaceResource> surface); // - std::vector<UP<CWpAlphaModifierV1>> m_vManagers; - std::unordered_map<wlr_surface*, UP<CAlphaModifier>> m_mAlphaModifiers; // xdg_toplevel -> deco + std::vector<UP<CWpAlphaModifierV1>> m_vManagers; + std::unordered_map<WP<CWLSurfaceResource>, UP<CAlphaModifier>> m_mAlphaModifiers; // xdg_toplevel -> deco friend class CAlphaModifier; }; namespace PROTO { inline UP<CAlphaModifierProtocol> alphaModifier; -};
\ No newline at end of file +}; |
