mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 00:05:58 +01:00
block surface feedback on window sharing
This commit is contained in:
parent
9c67e08dbd
commit
da76a1ed9e
3 changed files with 7 additions and 3 deletions
|
@ -341,7 +341,9 @@ bool CToplevelExportProtocolManager::copyFrameShm(SToplevelFrame* frame, timespe
|
||||||
g_pHyprOpenGL->clear(CColor(0, 0, 0, 255));
|
g_pHyprOpenGL->clear(CColor(0, 0, 0, 255));
|
||||||
|
|
||||||
// render client at 0,0
|
// render client at 0,0
|
||||||
|
g_pHyprRenderer->m_bBlockSurfaceFeedback = g_pHyprRenderer->shouldRenderWindow(frame->pWindow); // block the feedback to avoid spamming the surface if it's visible
|
||||||
g_pHyprRenderer->renderWindow(frame->pWindow, PMONITOR, now, false, RENDER_PASS_ALL, true, true);
|
g_pHyprRenderer->renderWindow(frame->pWindow, PMONITOR, now, false, RENDER_PASS_ALL, true, true);
|
||||||
|
g_pHyprRenderer->m_bBlockSurfaceFeedback = false;
|
||||||
|
|
||||||
// copy pixels
|
// copy pixels
|
||||||
const auto PFORMAT = get_gles2_format_from_drm(format);
|
const auto PFORMAT = get_gles2_format_from_drm(format);
|
||||||
|
|
|
@ -51,9 +51,10 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
|
||||||
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
|
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_surface_send_frame_done(surface, RDATA->when);
|
if (!g_pHyprRenderer->m_bBlockSurfaceFeedback) {
|
||||||
|
wlr_surface_send_frame_done(surface, RDATA->when);
|
||||||
wlr_presentation_surface_sampled_on_output(g_pCompositor->m_sWLRPresentation, surface, RDATA->output);
|
wlr_presentation_surface_sampled_on_output(g_pCompositor->m_sWLRPresentation, surface, RDATA->output);
|
||||||
|
}
|
||||||
|
|
||||||
// reset the UV, we might've set it above
|
// reset the UV, we might've set it above
|
||||||
g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft = Vector2D(-1, -1);
|
g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft = Vector2D(-1, -1);
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
void calculateUVForWindowSurface(CWindow*, wlr_surface*, bool main = false);
|
void calculateUVForWindowSurface(CWindow*, wlr_surface*, bool main = false);
|
||||||
|
|
||||||
bool m_bWindowRequestedCursorHide = false;
|
bool m_bWindowRequestedCursorHide = false;
|
||||||
|
bool m_bBlockSurfaceFeedback = false;
|
||||||
CWindow* m_pLastScanout = nullptr;
|
CWindow* m_pLastScanout = nullptr;
|
||||||
|
|
||||||
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);
|
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);
|
||||||
|
|
Loading…
Reference in a new issue