summaryrefslogtreecommitdiff
path: root/src/protocols/XDGShell.hpp
diff options
context:
space:
mode:
authoroutfoxxed <outfoxxed@outfoxxed.me>2024-07-27 13:43:01 -0700
committerGitHub <noreply@github.com>2024-07-27 21:43:01 +0100
commitbc86afea7e177a7ad4335737417fc0e468698dc4 (patch)
treeef098366026026cbe5c676c99fdec4af13615ca4 /src/protocols/XDGShell.hpp
parent6edfdd63a1fc87a6d874364c404c9b6f852c7096 (diff)
xdg-shell: completely rewrite xdg-positioner (#7067)
This implementation actually works.
Diffstat (limited to 'src/protocols/XDGShell.hpp')
-rw-r--r--src/protocols/XDGShell.hpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/protocols/XDGShell.hpp b/src/protocols/XDGShell.hpp
index da551718..e6812c38 100644
--- a/src/protocols/XDGShell.hpp
+++ b/src/protocols/XDGShell.hpp
@@ -4,10 +4,10 @@
#include <vector>
#include <cstdint>
#include <optional>
+#include <hyprutils/math/Edges.hpp>
#include "WaylandProtocol.hpp"
#include "xdg-shell.hpp"
#include "../helpers/math/Math.hpp"
-#include "../helpers/math/Math.hpp"
#include "../helpers/signal/Signal.hpp"
#include "types/SurfaceRole.hpp"
@@ -20,21 +20,24 @@ class CSeatGrab;
class CWLSurfaceResource;
struct SXDGPositionerState {
- Vector2D requestedSize;
- CBox anchorRect;
- xdgPositionerAnchor anchor = XDG_POSITIONER_ANCHOR_NONE;
- xdgPositionerGravity gravity = XDG_POSITIONER_GRAVITY_NONE;
- uint32_t constraintAdjustment = 0;
- Vector2D offset;
- bool reactive = false;
- Vector2D parentSize;
+ Vector2D requestedSize;
+ CBox anchorRect;
+ CEdges anchor;
+ CEdges gravity;
+ uint32_t constraintAdjustment = 0;
+ Vector2D offset;
+ bool reactive = false;
+ Vector2D parentSize;
+
+ void setAnchor(xdgPositionerAnchor edges);
+ void setGravity(xdgPositionerGravity edges);
};
class CXDGPositionerRules {
public:
CXDGPositionerRules(SP<CXDGPositionerResource> positioner);
- CBox getPosition(const CBox& constraint, const Vector2D& parentPos);
+ CBox getPosition(CBox constraint, const Vector2D& parentPos);
private:
SXDGPositionerState state;