surfacemgr: schedule all frames

schedule all frames instead of directly sending them.
This commit is contained in:
Tom Englund 2025-12-18 17:27:15 +01:00
parent b1c6b0d4b8
commit c5fed0f545
4 changed files with 8 additions and 7 deletions

View file

@ -161,7 +161,7 @@ void CPointerManager::setCursorSurface(SP<Desktop::View::CWLSurface> surf, const
if (surf->resource()->m_current.texture) { if (surf->resource()->m_current.texture) {
m_currentCursorImage.size = surf->resource()->m_current.bufferSize; m_currentCursorImage.size = surf->resource()->m_current.bufferSize;
g_pSurfaceManager->sendFrameCallbacks(surf->resource(), Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(Desktop::focusState()->monitor(), surf->resource());
} }
} }
@ -598,7 +598,7 @@ void CPointerManager::renderSoftwareCursorsFor(PHLMONITOR pMonitor, const Time::
if (!state->hardwareFailed && state->softwareLocks == 0 && !forceRender) { if (!state->hardwareFailed && state->softwareLocks == 0 && !forceRender) {
if (m_currentCursorImage.surface) if (m_currentCursorImage.surface)
g_pSurfaceManager->sendFrameCallbacks(m_currentCursorImage.surface->resource(), Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(pMonitor, m_currentCursorImage.surface->resource());
return; return;
} }
@ -634,7 +634,7 @@ void CPointerManager::renderSoftwareCursorsFor(PHLMONITOR pMonitor, const Time::
g_pHyprRenderer->m_renderPass.add(makeUnique<CTexPassElement>(std::move(data))); g_pHyprRenderer->m_renderPass.add(makeUnique<CTexPassElement>(std::move(data)));
if (m_currentCursorImage.surface) if (m_currentCursorImage.surface)
g_pSurfaceManager->sendFrameCallbacks(m_currentCursorImage.surface->resource(), Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(pMonitor, m_currentCursorImage.surface->resource());
} }
Vector2D CPointerManager::getCursorPosForMonitor(PHLMONITOR pMonitor) { Vector2D CPointerManager::getCursorPosForMonitor(PHLMONITOR pMonitor) {

View file

@ -15,6 +15,7 @@
#include "config/ConfigValue.hpp" #include "config/ConfigValue.hpp"
#include "../../managers/eventLoop/EventLoopManager.hpp" #include "../../managers/eventLoop/EventLoopManager.hpp"
#include "../../managers/SurfaceManager.hpp" #include "../../managers/SurfaceManager.hpp"
#include "../../desktop/state/FocusState.hpp"
#include "protocols/types/SurfaceRole.hpp" #include "protocols/types/SurfaceRole.hpp"
#include "render/Texture.hpp" #include "render/Texture.hpp"
#include <cstring> #include <cstring>
@ -433,7 +434,7 @@ void CWLSurfaceResource::map() {
m_mapped = true; m_mapped = true;
g_pSurfaceManager->sendFrameCallbacks(m_self, Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(Desktop::focusState()->monitor(), m_self);
m_current.bufferDamage = CBox{{}, m_current.bufferSize}; m_current.bufferDamage = CBox{{}, m_current.bufferSize};
m_pending.bufferDamage = CBox{{}, m_pending.bufferSize}; m_pending.bufferDamage = CBox{{}, m_pending.bufferSize};

View file

@ -837,7 +837,7 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, const Time::steady_tp
CBox damageBox = CBox{surfacePos, m_dnd.dndSurface->m_current.size}.expand(5); CBox damageBox = CBox{surfacePos, m_dnd.dndSurface->m_current.size}.expand(5);
g_pHyprRenderer->damageBox(damageBox); g_pHyprRenderer->damageBox(damageBox);
g_pSurfaceManager->sendFrameCallbacks(m_dnd.dndSurface, when); g_pSurfaceManager->scheduleForFrame(pMonitor, m_dnd.dndSurface);
} }
bool CWLDataDeviceProtocol::dndActive() { bool CWLDataDeviceProtocol::dndActive() {

View file

@ -171,7 +171,7 @@ CHyprRenderer::CHyprRenderer() {
if (!w->wlSurface() || !w->wlSurface()->resource() || shouldRenderWindow(w.lock())) if (!w->wlSurface() || !w->wlSurface()->resource() || shouldRenderWindow(w.lock()))
continue; continue;
g_pSurfaceManager->sendFrameCallbacks(w->wlSurface()->resource(), Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(Desktop::focusState()->monitor(), w->wlSurface()->resource());
auto FEEDBACK = makeUnique<CQueuedPresentationData>(w->wlSurface()->resource()); auto FEEDBACK = makeUnique<CQueuedPresentationData>(w->wlSurface()->resource());
FEEDBACK->attachMonitor(Desktop::focusState()->monitor()); FEEDBACK->attachMonitor(Desktop::focusState()->monitor());
@ -1738,7 +1738,7 @@ void CHyprRenderer::sendFrameEventsToWorkspace(PHLMONITOR pMonitor, PHLWORKSPACE
if (!view->aliveAndVisible()) if (!view->aliveAndVisible())
continue; continue;
g_pSurfaceManager->sendFrameCallbacks(view->wlSurface()->resource(), Time::steadyNow()); g_pSurfaceManager->scheduleForFrame(pMonitor, view->wlSurface()->resource());
} }
} }