summaryrefslogtreecommitdiff
path: root/src/desktop
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/desktop
parent6edfdd63a1fc87a6d874364c404c9b6f852c7096 (diff)
xdg-shell: completely rewrite xdg-positioner (#7067)
This implementation actually works.
Diffstat (limited to 'src/desktop')
-rw-r--r--src/desktop/Popup.cpp10
-rw-r--r--src/desktop/Popup.hpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp
index 131a26b5..e48b7400 100644
--- a/src/desktop/Popup.cpp
+++ b/src/desktop/Popup.cpp
@@ -22,7 +22,7 @@ CPopup::CPopup(SP<CXDGPopupResource> popup, CPopup* pOwner) : m_pParent(pOwner),
m_pWindowOwner = pOwner->m_pWindowOwner;
m_vLastSize = popup->surface->current.geometry.size();
- unconstrain();
+ reposition();
initAllSignals();
}
@@ -188,18 +188,18 @@ void CPopup::onReposition() {
m_vLastPos = coordsRelativeToParent();
- unconstrain();
+ reposition();
}
-void CPopup::unconstrain() {
+void CPopup::reposition() {
const auto COORDS = t1ParentCoords();
const auto PMONITOR = g_pCompositor->getMonitorFromVector(COORDS);
if (!PMONITOR)
return;
- CBox box = {PMONITOR->vecPosition.x - COORDS.x, PMONITOR->vecPosition.y - COORDS.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y};
- m_pResource->applyPositioning(box, COORDS - PMONITOR->vecPosition);
+ CBox box = {PMONITOR->vecPosition.x, PMONITOR->vecPosition.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y};
+ m_pResource->applyPositioning(box, COORDS);
}
Vector2D CPopup::coordsRelativeToParent() {
diff --git a/src/desktop/Popup.hpp b/src/desktop/Popup.hpp
index d045cd41..eea3fb84 100644
--- a/src/desktop/Popup.hpp
+++ b/src/desktop/Popup.hpp
@@ -74,11 +74,11 @@ class CPopup {
} listeners;
void initAllSignals();
- void unconstrain();
+ void reposition();
void recheckChildrenRecursive();
void sendScale();
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
+};