From 788a8f7c134a34085d683e44a328e344be6b21f3 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 20 Mar 2023 15:00:58 +0000 Subject: internal: wrap wlr surfaces (#1822) --- src/Window.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Window.cpp') diff --git a/src/Window.cpp b/src/Window.cpp index afa9ba7d..19fb68c2 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -265,9 +265,9 @@ void CWindow::updateSurfaceOutputs() { const auto PNEWMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); if (PLASTMONITOR && PLASTMONITOR->m_bEnabled) - wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendLeaveIter, PLASTMONITOR->output); + wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendLeaveIter, PLASTMONITOR->output); - wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendEnterIter, PNEWMONITOR->output); + wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendEnterIter, PNEWMONITOR->output); } void CWindow::moveToWorkspace(int workspaceID) { @@ -285,7 +285,7 @@ void CWindow::moveToWorkspace(int workspaceID) { } if (PMONITOR) - g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(g_pXWaylandManager->getWindowSurface(this), PMONITOR->scale); + g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(m_pWLSurface.wlr(), PMONITOR->scale); } CWindow* CWindow::X11TransientFor() { @@ -340,6 +340,8 @@ void CWindow::onUnmap() { void CWindow::onMap() { + m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(this)); + // JIC, reset the callbacks. If any are set, we'll make sure they are cleared so we don't accidentally unset them. (In case a window got remapped) m_vRealPosition.resetAllCallbacks(); m_vRealSize.resetAllCallbacks(); -- cgit v1.2.3