aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp23
-rw-r--r--src/render/Renderer.hpp2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 86528f53..1386d1c7 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -31,7 +31,7 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
wlr_presentation_surface_sampled_on_output(g_pCompositor->m_sWLRPresentation, surface, RDATA->output);
}
-bool shouldRenderWindow(CWindow* pWindow, SMonitor* pMonitor) {
+bool CHyprRenderer::shouldRenderWindow(CWindow* pWindow, SMonitor* pMonitor) {
wlr_box geometry = pWindow->getFullWindowBoundingBox();
if (!wlr_output_layout_intersects(g_pCompositor->m_sWLROutputLayout, pMonitor->output, &geometry))
@@ -52,6 +52,27 @@ bool shouldRenderWindow(CWindow* pWindow, SMonitor* pMonitor) {
return false;
}
+bool CHyprRenderer::shouldRenderWindow(CWindow* pWindow) {
+
+ if (!g_pCompositor->windowValidMapped(pWindow))
+ return false;
+
+ const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
+
+ if (g_pCompositor->isWorkspaceVisible(pWindow->m_iWorkspaceID))
+ return true;
+
+ for (auto& m : g_pCompositor->m_lMonitors) {
+ if (PWORKSPACE && PWORKSPACE->m_iMonitorID == m.ID && (PWORKSPACE->m_vRenderOffset.isBeingAnimated() || PWORKSPACE->m_fAlpha.isBeingAnimated()))
+ return true;
+
+ if (m.specialWorkspaceOpen && pWindow->m_iWorkspaceID == SPECIAL_WORKSPACE_ID)
+ return true;
+ }
+
+ return false;
+}
+
void CHyprRenderer::renderWorkspaceWithFullscreenWindow(SMonitor* pMonitor, CWorkspace* pWorkspace, timespec* time) {
CWindow* pWorkspaceWindow = nullptr;
diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp
index ba7d54b3..24caa09d 100644
--- a/src/render/Renderer.hpp
+++ b/src/render/Renderer.hpp
@@ -29,6 +29,8 @@ public:
void damageBox(const int& x, const int& y, const int& w, const int& h);
void damageMonitor(SMonitor*);
void applyMonitorRule(SMonitor*, SMonitorRule*, bool force = false);
+ bool shouldRenderWindow(CWindow*, SMonitor*);
+ bool shouldRenderWindow(CWindow*);
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);