aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-04-23 16:08:54 +0100
committerVaxry <[email protected]>2024-04-23 16:08:54 +0100
commita2366f78f0ddfc241811b48dfdb1289b81de0e1e (patch)
treea072802adef63cbf41d5bd03190ce48c7f04e246
parentcf3596a96d5c1012c363d8243baca6431ecf835b (diff)
downloadHyprland-a2366f78f0ddfc241811b48dfdb1289b81de0e1e.tar.gz
Hyprland-a2366f78f0ddfc241811b48dfdb1289b81de0e1e.zip
renderer: send frame events to apps on empty damage renders
fixes #5711
-rw-r--r--src/render/Renderer.cpp27
-rw-r--r--src/render/Renderer.hpp1
2 files changed, 26 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 9bb75210..8b6be201 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1322,9 +1322,12 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
damageBlinkCleanup = 0;
}
}
- } else {
+ } else
g_pHyprRenderer->renderWindow(pMonitor->solitaryClient, pMonitor, &now, false, RENDER_PASS_MAIN /* solitary = no popups */);
- }
+ } else {
+ sendFrameEventsToWorkspace(pMonitor, pMonitor->activeWorkspace, &now);
+ if (pMonitor->activeSpecialWorkspace)
+ sendFrameEventsToWorkspace(pMonitor, pMonitor->activeSpecialWorkspace, &now);
}
renderCursor = renderCursor && shouldRenderCursor();
@@ -1420,6 +1423,26 @@ void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace,
g_pHyprOpenGL->m_RenderData.pWorkspace = nullptr;
}
+void CHyprRenderer::sendFrameEventsToWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now) {
+ for (auto& w : g_pCompositor->m_vWindows) {
+ if (w->isHidden() && !w->m_bIsMapped && !w->m_bFadingOut)
+ continue;
+
+ if (!shouldRenderWindow(w.get(), pMonitor))
+ continue;
+
+ wlr_surface_for_each_surface(
+ w->m_pWLSurface.wlr(), [](wlr_surface* s, int x, int y, void* data) { wlr_surface_send_frame_done(s, (timespec*)data); }, now);
+ }
+
+ for (auto& lsl : pMonitor->m_aLayerSurfaceLayers) {
+ for (auto& ls : lsl) {
+ wlr_surface_for_each_surface(
+ ls->surface.wlr(), [](wlr_surface* s, int x, int y, void* data) { wlr_surface_send_frame_done(s, (timespec*)data); }, now);
+ }
+ }
+}
+
void CHyprRenderer::setWindowScanoutMode(CWindow* pWindow) {
if (!g_pCompositor->m_sWLRLinuxDMABuf || g_pSessionLockManager->isSessionLocked())
return;
diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp
index 2e2b8b92..0a0ae5c9 100644
--- a/src/render/Renderer.hpp
+++ b/src/render/Renderer.hpp
@@ -117,6 +117,7 @@ class CHyprRenderer {
void renderDragIcon(CMonitor*, timespec*);
void renderIMEPopup(CInputPopup*, CMonitor*, timespec*);
void renderWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now, const CBox& geometry);
+ void sendFrameEventsToWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now); // sends frame displayed events but doesn't actually render anything
void renderAllClientsForWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now, const Vector2D& translate = {0, 0}, const float& scale = 1.f);
bool m_bCursorHidden = false;