windows: refactor class member vars (#10168)
This commit is contained in:
parent
c505eb55ff
commit
2118440488
43 changed files with 2124 additions and 2134 deletions
|
|
@ -60,8 +60,8 @@ void CForeignToplevelList::onMap(PHLWINDOW pWindow) {
|
|||
LOGM(LOG, "Newly mapped window gets an identifier of {}", IDENTIFIER);
|
||||
resource->sendToplevel(NEWHANDLE->resource.get());
|
||||
NEWHANDLE->resource->sendIdentifier(IDENTIFIER.c_str());
|
||||
NEWHANDLE->resource->sendAppId(pWindow->m_szInitialClass.c_str());
|
||||
NEWHANDLE->resource->sendTitle(pWindow->m_szInitialTitle.c_str());
|
||||
NEWHANDLE->resource->sendAppId(pWindow->m_initialClass.c_str());
|
||||
NEWHANDLE->resource->sendTitle(pWindow->m_initialTitle.c_str());
|
||||
NEWHANDLE->resource->sendDone();
|
||||
|
||||
handles.push_back(NEWHANDLE);
|
||||
|
|
@ -81,7 +81,7 @@ void CForeignToplevelList::onTitle(PHLWINDOW pWindow) {
|
|||
if UNLIKELY (!H || H->closed)
|
||||
return;
|
||||
|
||||
H->resource->sendTitle(pWindow->m_szTitle.c_str());
|
||||
H->resource->sendTitle(pWindow->m_title.c_str());
|
||||
H->resource->sendDone();
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ void CForeignToplevelList::onClass(PHLWINDOW pWindow) {
|
|||
if UNLIKELY (!H || H->closed)
|
||||
return;
|
||||
|
||||
H->resource->sendAppId(pWindow->m_szClass.c_str());
|
||||
H->resource->sendAppId(pWindow->m_class.c_str());
|
||||
H->resource->sendDone();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_eSuppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_bIsMapped) {
|
||||
PWINDOW->m_bWantsInitialFullscreen = true;
|
||||
if UNLIKELY (!PWINDOW->m_isMapped) {
|
||||
PWINDOW->m_wantsInitialFullscreen = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if (!wpMonitor.expired()) {
|
||||
const auto monitor = wpMonitor.lock();
|
||||
|
||||
if (PWINDOW->m_pWorkspace != monitor->activeWorkspace) {
|
||||
if (PWINDOW->m_workspace != monitor->activeWorkspace) {
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, monitor->activeWorkspace);
|
||||
g_pCompositor->setActiveMonitor(monitor);
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_eSuppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
return;
|
||||
|
||||
g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_FULLSCREEN, false);
|
||||
|
|
@ -75,11 +75,11 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_eSuppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_bIsMapped) {
|
||||
PWINDOW->m_bWantsInitialFullscreen = true;
|
||||
if UNLIKELY (!PWINDOW->m_isMapped) {
|
||||
PWINDOW->m_wantsInitialFullscreen = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_eSuppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
return;
|
||||
|
||||
g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_MAXIMIZED, false);
|
||||
|
|
@ -104,7 +104,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_bIsMapped)
|
||||
if UNLIKELY (!PWINDOW->m_isMapped)
|
||||
return;
|
||||
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{.event = "minimized", .data = std::format("{:x},1", (uintptr_t)PWINDOW.get())});
|
||||
|
|
@ -116,7 +116,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_bIsMapped)
|
||||
if UNLIKELY (!PWINDOW->m_isMapped)
|
||||
return;
|
||||
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{.event = "minimized", .data = std::format("{:x},0", (uintptr_t)PWINDOW.get())});
|
||||
|
|
@ -170,7 +170,7 @@ void CForeignToplevelHandleWlr::sendMonitor(PHLMONITOR pMonitor) {
|
|||
void CForeignToplevelHandleWlr::sendState() {
|
||||
const auto PWINDOW = pWindow.lock();
|
||||
|
||||
if UNLIKELY (!PWINDOW || !PWINDOW->m_pWorkspace || !PWINDOW->m_bIsMapped)
|
||||
if UNLIKELY (!PWINDOW || !PWINDOW->m_workspace || !PWINDOW->m_isMapped)
|
||||
return;
|
||||
|
||||
wl_array state;
|
||||
|
|
@ -233,9 +233,9 @@ void CForeignToplevelWlrManager::onMap(PHLWINDOW pWindow) {
|
|||
|
||||
LOGM(LOG, "Newly mapped window {:016x}", (uintptr_t)pWindow.get());
|
||||
resource->sendToplevel(NEWHANDLE->resource.get());
|
||||
NEWHANDLE->resource->sendAppId(pWindow->m_szClass.c_str());
|
||||
NEWHANDLE->resource->sendTitle(pWindow->m_szTitle.c_str());
|
||||
if LIKELY (const auto PMONITOR = pWindow->m_pMonitor.lock(); PMONITOR)
|
||||
NEWHANDLE->resource->sendAppId(pWindow->m_class.c_str());
|
||||
NEWHANDLE->resource->sendTitle(pWindow->m_title.c_str());
|
||||
if LIKELY (const auto PMONITOR = pWindow->m_monitor.lock(); PMONITOR)
|
||||
NEWHANDLE->sendMonitor(PMONITOR);
|
||||
NEWHANDLE->sendState();
|
||||
NEWHANDLE->resource->sendDone();
|
||||
|
|
@ -257,7 +257,7 @@ void CForeignToplevelWlrManager::onTitle(PHLWINDOW pWindow) {
|
|||
if UNLIKELY (!H || H->closed)
|
||||
return;
|
||||
|
||||
H->resource->sendTitle(pWindow->m_szTitle.c_str());
|
||||
H->resource->sendTitle(pWindow->m_title.c_str());
|
||||
H->resource->sendDone();
|
||||
}
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ void CForeignToplevelWlrManager::onClass(PHLWINDOW pWindow) {
|
|||
if UNLIKELY (!H || H->closed)
|
||||
return;
|
||||
|
||||
H->resource->sendAppId(pWindow->m_szClass.c_str());
|
||||
H->resource->sendAppId(pWindow->m_class.c_str());
|
||||
H->resource->sendDone();
|
||||
}
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ void CForeignToplevelWlrManager::onMoveMonitor(PHLWINDOW pWindow) {
|
|||
if UNLIKELY (!H || H->closed)
|
||||
return;
|
||||
|
||||
const auto PMONITOR = pWindow->m_pMonitor.lock();
|
||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||
|
||||
if UNLIKELY (!PMONITOR)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ void CLinuxDMABufV1Protocol::resetFormatTable() {
|
|||
PHLMONITOR mon;
|
||||
auto HLSurface = CWLSurface::fromResource(feedback->surface);
|
||||
if (auto w = HLSurface->getWindow(); w)
|
||||
if (auto m = w->m_pMonitor.lock(); m)
|
||||
if (auto m = w->m_monitor.lock(); m)
|
||||
mon = m->self.lock();
|
||||
|
||||
if (!mon) {
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWL
|
|||
float scale = 1.f;
|
||||
const auto PWINDOW = pHLSurface->getWindow();
|
||||
if (PWINDOW) {
|
||||
const auto ISXWL = PWINDOW->m_bIsX11;
|
||||
scale = ISXWL && *PXWLFORCESCALEZERO ? PWINDOW->m_fX11SurfaceScaledBy : 1.f;
|
||||
const auto ISXWL = PWINDOW->m_isX11;
|
||||
scale = ISXWL && *PXWLFORCESCALEZERO ? PWINDOW->m_X11SurfaceScaledBy : 1.f;
|
||||
}
|
||||
|
||||
positionHint = {wl_fixed_to_double(x) / scale, wl_fixed_to_double(y) / scale};
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ bool CKeyboardShortcutsInhibitProtocol::isInhibited() {
|
|||
if (!g_pCompositor->m_lastFocus)
|
||||
return false;
|
||||
|
||||
if (const auto PWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_lastFocus.lock()); PWINDOW && PWINDOW->m_sWindowData.noShortcutsInhibit.valueOrDefault())
|
||||
if (const auto PWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_lastFocus.lock()); PWINDOW && PWINDOW->m_windowData.noShortcutsInhibit.valueOrDefault())
|
||||
return false;
|
||||
|
||||
for (auto const& in : m_vInhibitors) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ CTearingControl::CTearingControl(SP<CWpTearingControlV1> resource_, SP<CWLSurfac
|
|||
resource->setSetPresentationHint([this](CWpTearingControlV1* res, wpTearingControlV1PresentationHint hint) { this->onHint(hint); });
|
||||
|
||||
for (auto const& w : g_pCompositor->m_windows) {
|
||||
if (w->m_pWLSurface->resource() == surf_) {
|
||||
if (w->m_wlSurface->resource() == surf_) {
|
||||
pWindow = w;
|
||||
break;
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ void CTearingControl::updateWindow() {
|
|||
if UNLIKELY (pWindow.expired())
|
||||
return;
|
||||
|
||||
pWindow->m_bTearingHint = hint == WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC;
|
||||
pWindow->m_tearingHint = hint == WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC;
|
||||
}
|
||||
|
||||
bool CTearingControl::good() {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ CToplevelExportFrame::CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> re
|
|||
return;
|
||||
}
|
||||
|
||||
if UNLIKELY (!pWindow->m_bIsMapped) {
|
||||
if UNLIKELY (!pWindow->m_isMapped) {
|
||||
LOGM(ERR, "Client requested sharing of window handle {:x} which is not shareable!", pWindow);
|
||||
resource->sendFailed();
|
||||
return;
|
||||
|
|
@ -96,7 +96,7 @@ CToplevelExportFrame::CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> re
|
|||
resource->setDestroy([this](CHyprlandToplevelExportFrameV1* pFrame) { PROTO::toplevelExport->destroyResource(this); });
|
||||
resource->setCopy([this](CHyprlandToplevelExportFrameV1* pFrame, wl_resource* res, int32_t ignoreDamage) { this->copy(pFrame, res, ignoreDamage); });
|
||||
|
||||
const auto PMONITOR = pWindow->m_pMonitor.lock();
|
||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||
|
||||
g_pHyprRenderer->makeEGLCurrent();
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ CToplevelExportFrame::CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> re
|
|||
|
||||
dmabufFormat = PMONITOR->output->state->state().drmFormat;
|
||||
|
||||
box = {0, 0, (int)(pWindow->m_vRealSize->value().x * PMONITOR->scale), (int)(pWindow->m_vRealSize->value().y * PMONITOR->scale)};
|
||||
box = {0, 0, (int)(pWindow->m_realSize->value().x * PMONITOR->scale), (int)(pWindow->m_realSize->value().y * PMONITOR->scale)};
|
||||
|
||||
box.transform(wlTransformToHyprutils(PMONITOR->transform), PMONITOR->vecTransformedSize.x, PMONITOR->vecTransformedSize.y).round();
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou
|
|||
return;
|
||||
}
|
||||
|
||||
if UNLIKELY (!pWindow->m_bIsMapped) {
|
||||
if UNLIKELY (!pWindow->m_isMapped) {
|
||||
LOGM(ERR, "Client requested sharing of window handle {:x} which is not shareable (2)!", pWindow);
|
||||
resource->sendFailed();
|
||||
return;
|
||||
|
|
@ -235,7 +235,7 @@ bool CToplevelExportFrame::copyShm(const Time::steady_tp& now) {
|
|||
auto [pixelData, fmt, bufLen] = buffer->beginDataPtr(0); // no need for end, cuz it's shm
|
||||
|
||||
// render the client
|
||||
const auto PMONITOR = pWindow->m_pMonitor.lock();
|
||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||
CRegion fakeDamage{0, 0, PMONITOR->vecPixelSize.x * 10, PMONITOR->vecPixelSize.y * 10};
|
||||
|
||||
g_pHyprRenderer->makeEGLCurrent();
|
||||
|
|
@ -262,7 +262,7 @@ bool CToplevelExportFrame::copyShm(const Time::steady_tp& now) {
|
|||
g_pHyprRenderer->m_bBlockSurfaceFeedback = false;
|
||||
|
||||
if (overlayCursor)
|
||||
g_pPointerManager->renderSoftwareCursorsFor(PMONITOR->self.lock(), now, fakeDamage, g_pInputManager->getMouseCoordsInternal() - pWindow->m_vRealPosition->value());
|
||||
g_pPointerManager->renderSoftwareCursorsFor(PMONITOR->self.lock(), now, fakeDamage, g_pInputManager->getMouseCoordsInternal() - pWindow->m_realPosition->value());
|
||||
} else if (PERM == PERMISSION_RULE_ALLOW_MODE_DENY) {
|
||||
CBox texbox =
|
||||
CBox{PMONITOR->vecTransformedSize / 2.F, g_pHyprOpenGL->m_pScreencopyDeniedTexture->m_vSize}.translate(-g_pHyprOpenGL->m_pScreencopyDeniedTexture->m_vSize / 2.F);
|
||||
|
|
@ -329,7 +329,7 @@ bool CToplevelExportFrame::copyShm(const Time::steady_tp& now) {
|
|||
|
||||
bool CToplevelExportFrame::copyDmabuf(const Time::steady_tp& now) {
|
||||
const auto PERM = g_pDynamicPermissionManager->clientPermissionMode(resource->client(), PERMISSION_TYPE_SCREENCOPY);
|
||||
const auto PMONITOR = pWindow->m_pMonitor.lock();
|
||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||
|
||||
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ bool CToplevelExportFrame::copyDmabuf(const Time::steady_tp& now) {
|
|||
g_pHyprRenderer->m_bBlockSurfaceFeedback = false;
|
||||
|
||||
if (overlayCursor)
|
||||
g_pPointerManager->renderSoftwareCursorsFor(PMONITOR->self.lock(), now, fakeDamage, g_pInputManager->getMouseCoordsInternal() - pWindow->m_vRealPosition->value());
|
||||
g_pPointerManager->renderSoftwareCursorsFor(PMONITOR->self.lock(), now, fakeDamage, g_pInputManager->getMouseCoordsInternal() - pWindow->m_realPosition->value());
|
||||
} else if (PERM == PERMISSION_RULE_ALLOW_MODE_DENY) {
|
||||
CBox texbox =
|
||||
CBox{PMONITOR->vecTransformedSize / 2.F, g_pHyprOpenGL->m_pScreencopyDeniedTexture->m_vSize}.translate(-g_pHyprOpenGL->m_pScreencopyDeniedTexture->m_vSize / 2.F);
|
||||
|
|
@ -445,10 +445,10 @@ void CToplevelExportProtocol::onOutputCommit(PHLMONITOR pMonitor) {
|
|||
|
||||
const auto PWINDOW = f->pWindow;
|
||||
|
||||
if (pMonitor != PWINDOW->m_pMonitor.lock())
|
||||
if (pMonitor != PWINDOW->m_monitor.lock())
|
||||
continue;
|
||||
|
||||
CBox geometry = {PWINDOW->m_vRealPosition->value().x, PWINDOW->m_vRealPosition->value().y, PWINDOW->m_vRealSize->value().x, PWINDOW->m_vRealSize->value().y};
|
||||
CBox geometry = {PWINDOW->m_realPosition->value().x, PWINDOW->m_realPosition->value().y, PWINDOW->m_realSize->value().x, PWINDOW->m_realSize->value().y};
|
||||
|
||||
if (geometry.intersection({pMonitor->vecPosition, pMonitor->vecSize}).empty())
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue