From 41a8975bd12f42732955ffc56c4a371f3c925205 Mon Sep 17 00:00:00 2001 From: Julian Schuler <31921487+julianschuler@users.noreply.github.com> Date: Sun, 20 Nov 2022 19:50:01 +0100 Subject: [PATCH] Render focused window at last (#1060) --- src/render/Renderer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 28ed0c7c..d40e8b11 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -408,6 +408,8 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) { return; } + CWindow* lastWindow = nullptr; + // Non-floating main for (auto& w : g_pCompositor->m_vWindows) { if (w->isHidden() && !w->m_bIsMapped && !w->m_bFadingOut) @@ -421,11 +423,20 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) { if (!shouldRenderWindow(w.get(), PMONITOR)) continue; + + // render active window after all others of this pass + if (w.get() == g_pCompositor->m_pLastWindow) { + lastWindow = w.get(); + continue; + } // render the bad boy renderWindow(w.get(), PMONITOR, time, true, RENDER_PASS_MAIN); } + if (lastWindow) + renderWindow(lastWindow, PMONITOR, time, true, RENDER_PASS_MAIN); + // Non-floating popup for (auto& w : g_pCompositor->m_vWindows) { if (w->isHidden() && !w->m_bIsMapped && !w->m_bFadingOut)