diff options
author | Vaxry <[email protected]> | 2024-05-09 21:47:21 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-05-09 22:02:18 +0100 |
commit | 635a02d83fe9d598cf5f6aba47e672647608fb76 (patch) | |
tree | 71f5e2ad0991af3086602c5b30b1411ee4c04562 /src/desktop/Popup.hpp | |
parent | 85f7f69046c07c61f59b0ef7cccd01e88b316413 (diff) | |
download | Hyprland-635a02d83fe9d598cf5f6aba47e672647608fb76.tar.gz Hyprland-635a02d83fe9d598cf5f6aba47e672647608fb76.zip |
layer-shell: move to new impl
Also bumps the hw-s dep
Diffstat (limited to 'src/desktop/Popup.hpp')
-rw-r--r-- | src/desktop/Popup.hpp | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/src/desktop/Popup.hpp b/src/desktop/Popup.hpp index cadbf244..6aa7ce61 100644 --- a/src/desktop/Popup.hpp +++ b/src/desktop/Popup.hpp @@ -3,6 +3,7 @@ #include <vector> #include <memory> #include "Subsurface.hpp" +#include "../helpers/signal/Listener.hpp" class CPopup { public: @@ -15,22 +16,27 @@ class CPopup { ~CPopup(); - Vector2D coordsRelativeToParent(); - Vector2D coordsGlobal(); + Vector2D coordsRelativeToParent(); + Vector2D coordsGlobal(); - Vector2D size(); + Vector2D size(); - void onNewPopup(wlr_xdg_popup* popup); - void onDestroy(); - void onMap(); - void onUnmap(); - void onCommit(bool ignoreSiblings = false); - void onReposition(); + void onNewPopup(wlr_xdg_popup* popup); + void onDestroy(); + void onMap(); + void onUnmap(); + void onCommit(bool ignoreSiblings = false); + void onReposition(); - void recheckTree(); + void recheckTree(); - bool visible(); + bool visible(); + // will also loop over this node + void breadthfirst(std::function<void(CPopup*, void*)> fn, void* data); + CPopup* at(const Vector2D& globalCoords, bool allowsInput = false); + + // CWLSurface m_sWLSurface; private: @@ -62,11 +68,16 @@ class CPopup { DYNLISTENER(commitPopup); DYNLISTENER(repositionPopup); - void initAllSignals(); - void unconstrain(); - void recheckChildrenRecursive(); - void sendScale(); + struct { + CHyprSignalListener newPopup; + } listeners; + + void initAllSignals(); + void unconstrain(); + void recheckChildrenRecursive(); + void sendScale(); - Vector2D localToGlobal(const Vector2D& rel); - Vector2D t1ParentCoords(); + Vector2D localToGlobal(const Vector2D& rel); + Vector2D t1ParentCoords(); + static void bfHelper(std::vector<CPopup*> nodes, std::function<void(CPopup*, void*)> fn, void* data); };
\ No newline at end of file |