mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 05:29:48 +01:00
renderer: skip rendering bottom layers on fullscreen opaque
This commit is contained in:
parent
d366fc48b8
commit
1911e4262b
3 changed files with 26 additions and 5 deletions
|
@ -668,3 +668,18 @@ void CWindow::updateGroupOutputs() {
|
||||||
Vector2D CWindow::middle() {
|
Vector2D CWindow::middle() {
|
||||||
return m_vRealPosition.goalv() + m_vRealSize.goalv() / 2.f;
|
return m_vRealPosition.goalv() + m_vRealSize.goalv() / 2.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CWindow::opaque() {
|
||||||
|
if (m_bIsX11)
|
||||||
|
return !m_uSurface.xwayland->has_alpha;
|
||||||
|
|
||||||
|
if (m_uSurface.xdg->surface->opaque)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
const auto EXTENTS = pixman_region32_extents(&m_uSurface.xdg->surface->opaque_region);
|
||||||
|
if (EXTENTS->x2 - EXTENTS->x1 >= m_uSurface.xdg->surface->current.buffer_width
|
||||||
|
&& EXTENTS->y2 - EXTENTS->y1 >= m_uSurface.xdg->surface->current.buffer_height)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -315,6 +315,7 @@ class CWindow {
|
||||||
void updateDynamicRules();
|
void updateDynamicRules();
|
||||||
SWindowDecorationExtents getFullWindowReservedArea();
|
SWindowDecorationExtents getFullWindowReservedArea();
|
||||||
Vector2D middle();
|
Vector2D middle();
|
||||||
|
bool opaque();
|
||||||
|
|
||||||
void onBorderAngleAnimEnd(void* ptr);
|
void onBorderAngleAnimEnd(void* ptr);
|
||||||
bool isInCurvedCorner(double x, double y);
|
bool isInCurvedCorner(double x, double y);
|
||||||
|
|
|
@ -440,12 +440,17 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace*
|
||||||
g_pHyprOpenGL->m_RenderData.renderModif = RENDERMODIFDATA;
|
g_pHyprOpenGL->m_RenderData.renderModif = RENDERMODIFDATA;
|
||||||
|
|
||||||
// Render layer surfaces below windows for monitor
|
// Render layer surfaces below windows for monitor
|
||||||
|
// if we have a fullscreen, opaque window that convers the screen, we can skip this.
|
||||||
|
// TODO: check better with solitary after MR for tearing.
|
||||||
|
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(pWorkspace->m_iID);
|
||||||
|
if (g_pHyprOpenGL->m_RenderData.pCurrentMonData->blurFBDirty || !pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() || !PFULLWINDOW->opaque()) {
|
||||||
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) {
|
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) {
|
||||||
renderLayer(ls.get(), pMonitor, time);
|
renderLayer(ls.get(), pMonitor, time);
|
||||||
}
|
}
|
||||||
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]) {
|
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]) {
|
||||||
renderLayer(ls.get(), pMonitor, time);
|
renderLayer(ls.get(), pMonitor, time);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// pre window pass
|
// pre window pass
|
||||||
g_pHyprOpenGL->preWindowPass();
|
g_pHyprOpenGL->preWindowPass();
|
||||||
|
|
Loading…
Reference in a new issue