input: focus window on mouse down on decoration (#4514)

Also unifies vectorToWindow funcs
This commit is contained in:
MightyPlaza 2024-02-04 15:40:20 +00:00 committed by GitHub
parent 1ed4f1cb25
commit cbadf3e3f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 105 additions and 162 deletions

View file

@ -541,7 +541,7 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool
if (!pWindow) {
if (*PFOLLOWMOUSE == 1)
pWindow = g_pCompositor->vectorToWindowIdeal(g_pInputManager->getMouseCoordsInternal());
pWindow = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
if (!pWindow)
pWindow = g_pCompositor->getTopLeftWindowOnWorkspace(pWorkspace->m_iID);

View file

@ -45,3 +45,7 @@ double Vector2D::distance(const Vector2D& other) const {
double Vector2D::size() const {
return std::sqrt(x * x + y * y);
}
Vector2D Vector2D::getComponentMax(const Vector2D& other) const {
return Vector2D(std::max(this->x, other.x), std::max(this->y, other.y));
}

View file

@ -92,6 +92,8 @@ class Vector2D {
Vector2D floor() const;
Vector2D round() const;
Vector2D getComponentMax(const Vector2D& other) const;
};
/**