mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 04:10:04 +01:00
desktop/popup: fix invalid surface coord
This commit is contained in:
parent
c94a981711
commit
cbfdbe9fa1
2 changed files with 11 additions and 11 deletions
|
|
@ -91,7 +91,7 @@ std::optional<CBox> CPopup::surfaceLogicalBox() const {
|
||||||
if (!visible())
|
if (!visible())
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
||||||
return CBox{t1ParentCoords(), size()};
|
return CBox{coordsGlobal(), size()};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPopup::desktopComponent() const {
|
bool CPopup::desktopComponent() const {
|
||||||
|
|
@ -338,14 +338,14 @@ void CPopup::reposition() {
|
||||||
m_resource->applyPositioning(box, COORDS);
|
m_resource->applyPositioning(box, COORDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SP<Desktop::View::CWLSurface> CPopup::getT1Owner() {
|
SP<Desktop::View::CWLSurface> CPopup::getT1Owner() const {
|
||||||
if (m_windowOwner)
|
if (m_windowOwner)
|
||||||
return m_windowOwner->wlSurface();
|
return m_windowOwner->wlSurface();
|
||||||
else
|
else
|
||||||
return m_layerOwner->wlSurface();
|
return m_layerOwner->wlSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D CPopup::coordsRelativeToParent() {
|
Vector2D CPopup::coordsRelativeToParent() const {
|
||||||
Vector2D offset;
|
Vector2D offset;
|
||||||
|
|
||||||
if (!m_resource)
|
if (!m_resource)
|
||||||
|
|
@ -365,11 +365,11 @@ Vector2D CPopup::coordsRelativeToParent() {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D CPopup::coordsGlobal() {
|
Vector2D CPopup::coordsGlobal() const {
|
||||||
return localToGlobal(coordsRelativeToParent());
|
return localToGlobal(coordsRelativeToParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D CPopup::localToGlobal(const Vector2D& rel) {
|
Vector2D CPopup::localToGlobal(const Vector2D& rel) const {
|
||||||
return t1ParentCoords() + rel;
|
return t1ParentCoords() + rel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -483,7 +483,7 @@ bool CPopup::inert() const {
|
||||||
return m_inert;
|
return m_inert;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHLMONITOR CPopup::getMonitor() {
|
PHLMONITOR CPopup::getMonitor() const {
|
||||||
if (!m_windowOwner.expired())
|
if (!m_windowOwner.expired())
|
||||||
return m_windowOwner->m_monitor.lock();
|
return m_windowOwner->m_monitor.lock();
|
||||||
if (!m_layerOwner.expired())
|
if (!m_layerOwner.expired())
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,10 @@ namespace Desktop::View {
|
||||||
virtual bool desktopComponent() const;
|
virtual bool desktopComponent() const;
|
||||||
virtual std::optional<CBox> surfaceLogicalBox() const;
|
virtual std::optional<CBox> surfaceLogicalBox() const;
|
||||||
|
|
||||||
SP<Desktop::View::CWLSurface> getT1Owner();
|
SP<Desktop::View::CWLSurface> getT1Owner() const;
|
||||||
Vector2D coordsRelativeToParent();
|
Vector2D coordsRelativeToParent() const;
|
||||||
Vector2D coordsGlobal();
|
Vector2D coordsGlobal() const;
|
||||||
PHLMONITOR getMonitor();
|
PHLMONITOR getMonitor() const;
|
||||||
|
|
||||||
Vector2D size() const;
|
Vector2D size() const;
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ namespace Desktop::View {
|
||||||
void sendScale();
|
void sendScale();
|
||||||
void fullyDestroy();
|
void fullyDestroy();
|
||||||
|
|
||||||
Vector2D localToGlobal(const Vector2D& rel);
|
Vector2D localToGlobal(const Vector2D& rel) const;
|
||||||
Vector2D t1ParentCoords() const;
|
Vector2D t1ParentCoords() const;
|
||||||
static void bfHelper(std::vector<SP<CPopup>> const& nodes, std::function<void(SP<CPopup>, void*)> fn, void* data);
|
static void bfHelper(std::vector<SP<CPopup>> const& nodes, std::function<void(SP<CPopup>, void*)> fn, void* data);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue