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/FocusGrab.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/FocusGrab.hpp')
| -rw-r--r-- | src/protocols/FocusGrab.hpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/protocols/FocusGrab.hpp b/src/protocols/FocusGrab.hpp index 40922c22..80166f9f 100644 --- a/src/protocols/FocusGrab.hpp +++ b/src/protocols/FocusGrab.hpp @@ -6,13 +6,15 @@ #include <cstdint> #include <unordered_map> #include <vector> +#include "../helpers/signal/Listener.hpp" class CFocusGrab; class CSeatGrab; +class CWLSurfaceResource; class CFocusGrabSurfaceState { public: - CFocusGrabSurfaceState(CFocusGrab* grab, wlr_surface* surface); + CFocusGrabSurfaceState(CFocusGrab* grab, SP<CWLSurfaceResource> surface); ~CFocusGrabSurfaceState(); enum State { @@ -22,7 +24,9 @@ class CFocusGrabSurfaceState { } state = PendingAddition; private: - DYNLISTENER(surfaceDestroy); + struct { + CHyprSignalListener destroy; + } listeners; }; class CFocusGrab { @@ -31,23 +35,23 @@ class CFocusGrab { ~CFocusGrab(); bool good(); - bool isSurfaceComitted(wlr_surface* surface); + bool isSurfaceComitted(SP<CWLSurfaceResource> surface); void start(); void finish(bool sendCleared); private: - void addSurface(wlr_surface* surface); - void removeSurface(wlr_surface* surface); - void eraseSurface(wlr_surface* surface); - void refocusKeyboard(); - void commit(bool removeOnly = false); + void addSurface(SP<CWLSurfaceResource> surface); + void removeSurface(SP<CWLSurfaceResource> surface); + void eraseSurface(SP<CWLSurfaceResource> surface); + void refocusKeyboard(); + void commit(bool removeOnly = false); - SP<CHyprlandFocusGrabV1> resource; - std::unordered_map<wlr_surface*, UP<CFocusGrabSurfaceState>> m_mSurfaces; - SP<CSeatGrab> grab; + SP<CHyprlandFocusGrabV1> resource; + std::unordered_map<WP<CWLSurfaceResource>, UP<CFocusGrabSurfaceState>> m_mSurfaces; + SP<CSeatGrab> grab; - bool m_bGrabActive = false; + bool m_bGrabActive = false; DYNLISTENER(pointerGrabStarted); DYNLISTENER(keyboardGrabStarted); |
