protocols: refactor class member vars (u-z) (#10282)

* protocols: refactor class member vars (u-z)

* protocols: fix clang format
This commit is contained in:
davc0n 2025-05-04 23:39:00 +02:00 committed by GitHub
parent 78ff20ddf0
commit 9cd5b25745
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 985 additions and 981 deletions

View file

@ -136,7 +136,7 @@ SP<CANRManager::SANRData> CANRManager::dataFor(PHLWINDOW pWindow) {
if (pWindow->m_xwaylandSurface)
it = std::ranges::find_if(m_data, [&pWindow](const auto& data) { return data->xwaylandSurface && data->xwaylandSurface == pWindow->m_xwaylandSurface; });
else if (pWindow->m_xdgSurface)
it = std::ranges::find_if(m_data, [&pWindow](const auto& data) { return data->xdgBase && data->xdgBase == pWindow->m_xdgSurface->owner; });
it = std::ranges::find_if(m_data, [&pWindow](const auto& data) { return data->xdgBase && data->xdgBase == pWindow->m_xdgSurface->m_owner; });
return it == m_data.end() ? nullptr : *it;
}
@ -150,7 +150,8 @@ SP<CANRManager::SANRData> CANRManager::dataFor(SP<CXWaylandSurface> pXwaylandSur
return it == m_data.end() ? nullptr : *it;
}
CANRManager::SANRData::SANRData(PHLWINDOW pWindow) : xwaylandSurface(pWindow->m_xwaylandSurface), xdgBase(pWindow->m_xdgSurface ? pWindow->m_xdgSurface->owner : WP<CXDGWMBase>{}) {
CANRManager::SANRData::SANRData(PHLWINDOW pWindow) :
xwaylandSurface(pWindow->m_xwaylandSurface), xdgBase(pWindow->m_xdgSurface ? pWindow->m_xdgSurface->m_owner : WP<CXDGWMBase>{}) {
;
}
@ -201,7 +202,7 @@ bool CANRManager::SANRData::fitsWindow(PHLWINDOW pWindow) const {
if (pWindow->m_xwaylandSurface)
return pWindow->m_xwaylandSurface == xwaylandSurface;
else if (pWindow->m_xdgSurface)
return pWindow->m_xdgSurface->owner == xdgBase && xdgBase;
return pWindow->m_xdgSurface->m_owner == xdgBase && xdgBase;
return false;
}

View file

@ -48,8 +48,8 @@ void CHyprXWaylandManager::activateSurface(SP<CWLSurfaceResource> pSurface, bool
}
PWINDOW->m_xwaylandSurface->activate(activate);
}
} else if (PWINDOW->m_xdgSurface && PWINDOW->m_xdgSurface->toplevel)
PWINDOW->m_xdgSurface->toplevel->setActive(activate);
} else if (PWINDOW->m_xdgSurface && PWINDOW->m_xdgSurface->m_toplevel)
PWINDOW->m_xdgSurface->m_toplevel->setActive(activate);
}
void CHyprXWaylandManager::activateWindow(PHLWINDOW pWindow, bool activate) {
@ -65,8 +65,8 @@ void CHyprXWaylandManager::activateWindow(PHLWINDOW pWindow, bool activate) {
pWindow->m_xwaylandSurface->activate(activate);
} else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->toplevel)
pWindow->m_xdgSurface->toplevel->setActive(activate);
} else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->m_toplevel)
pWindow->m_xdgSurface->m_toplevel->setActive(activate);
if (activate) {
g_pCompositor->m_lastFocus = getWindowSurface(pWindow);
@ -86,7 +86,7 @@ CBox CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow) {
if (pWindow->m_isX11)
box = pWindow->m_xwaylandSurface->geometry;
else if (pWindow->m_xdgSurface)
box = pWindow->m_xdgSurface->current.geometry;
box = pWindow->m_xdgSurface->m_current.geometry;
return box;
}
@ -94,8 +94,8 @@ CBox CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow) {
void CHyprXWaylandManager::sendCloseWindow(PHLWINDOW pWindow) {
if (pWindow->m_isX11)
pWindow->m_xwaylandSurface->close();
else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->toplevel)
pWindow->m_xdgSurface->toplevel->close();
else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->m_toplevel)
pWindow->m_xdgSurface->m_toplevel->close();
}
bool CHyprXWaylandManager::shouldBeFloated(PHLWINDOW pWindow, bool pending) {
@ -124,11 +124,11 @@ bool CHyprXWaylandManager::shouldBeFloated(PHLWINDOW pWindow, bool pending) {
(SIZEHINTS && (SIZEHINTS->min_width == SIZEHINTS->max_width) && (SIZEHINTS->min_height == SIZEHINTS->max_height)))
return true;
} else {
if (!pWindow->m_xdgSurface || !pWindow->m_xdgSurface->toplevel)
if (!pWindow->m_xdgSurface || !pWindow->m_xdgSurface->m_toplevel)
return false;
const auto PSTATE = pending ? &pWindow->m_xdgSurface->toplevel->pending : &pWindow->m_xdgSurface->toplevel->current;
if (pWindow->m_xdgSurface->toplevel->parent ||
const auto PSTATE = pending ? &pWindow->m_xdgSurface->m_toplevel->m_pending : &pWindow->m_xdgSurface->m_toplevel->m_current;
if (pWindow->m_xdgSurface->m_toplevel->m_parent ||
(PSTATE->minSize.x != 0 && PSTATE->minSize.y != 0 && (PSTATE->minSize.x == PSTATE->maxSize.x || PSTATE->minSize.y == PSTATE->maxSize.y)))
return true;
}
@ -160,8 +160,8 @@ void CHyprXWaylandManager::setWindowFullscreen(PHLWINDOW pWindow, bool fullscree
if (pWindow->m_isX11)
pWindow->m_xwaylandSurface->setFullscreen(fullscreen);
else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->toplevel)
pWindow->m_xdgSurface->toplevel->setFullscreen(fullscreen);
else if (pWindow->m_xdgSurface && pWindow->m_xdgSurface->m_toplevel)
pWindow->m_xdgSurface->m_toplevel->setFullscreen(fullscreen);
}
Vector2D CHyprXWaylandManager::waylandToXWaylandCoords(const Vector2D& coord) {

View file

@ -66,11 +66,11 @@ CInputManager::CInputManager() {
});
m_listeners.newIdleInhibitor = PROTO::idleInhibit->m_events.newIdleInhibitor.registerListener([this](std::any data) { this->newIdleInhibitor(data); });
m_listeners.newVirtualKeyboard = PROTO::virtualKeyboard->events.newKeyboard.registerListener([this](std::any data) {
m_listeners.newVirtualKeyboard = PROTO::virtualKeyboard->m_events.newKeyboard.registerListener([this](std::any data) {
this->newVirtualKeyboard(std::any_cast<SP<CVirtualKeyboardV1Resource>>(data));
updateCapabilities();
});
m_listeners.newVirtualMouse = PROTO::virtualPointer->events.newPointer.registerListener([this](std::any data) {
m_listeners.newVirtualMouse = PROTO::virtualPointer->m_events.newPointer.registerListener([this](std::any data) {
this->newVirtualMouse(std::any_cast<SP<CVirtualPointerV1Resource>>(data));
updateCapabilities();
});
@ -491,7 +491,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) {
if (pFoundWindow && !pFoundWindow->m_isX11 && surfacePos != Vector2D(-1337, -1337)) {
// calc for oversized windows... fucking bullshit.
CBox geom = pFoundWindow->m_xdgSurface->current.geometry;
CBox geom = pFoundWindow->m_xdgSurface->m_current.geometry;
surfaceLocal = mouseCoords - surfacePos + geom.pos();
}