fade control for fullscreen action on windows

This commit is contained in:
Vaxry 2022-09-19 17:26:11 +01:00
parent 696253b348
commit 85c7aaf155
2 changed files with 33 additions and 2 deletions

View file

@ -1614,8 +1614,11 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode
// make all windows on the same workspace under the fullscreen window // make all windows on the same workspace under the fullscreen window
for (auto& w : g_pCompositor->m_vWindows) { for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_iWorkspaceID == pWindow->m_iWorkspaceID) if (w->m_iWorkspaceID == pWindow->m_iWorkspaceID) {
w->m_bCreatedOverFullscreen = false; w->m_bCreatedOverFullscreen = false;
if (w.get() != pWindow && !w->m_bFadingOut)
w->m_fAlpha = pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL ? 0.f : 255.f;
}
} }
const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID); const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID);

View file

@ -122,6 +122,34 @@ bool CHyprRenderer::shouldRenderWindow(CWindow* pWindow) {
void CHyprRenderer::renderWorkspaceWithFullscreenWindow(CMonitor* pMonitor, CWorkspace* pWorkspace, timespec* time) { void CHyprRenderer::renderWorkspaceWithFullscreenWindow(CMonitor* pMonitor, CWorkspace* pWorkspace, timespec* time) {
CWindow* pWorkspaceWindow = nullptr; CWindow* pWorkspaceWindow = nullptr;
// loop over the tiled windows that are fading out
for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_iWorkspaceID != pMonitor->activeWorkspace)
continue;
if (w->m_fAlpha.fl() == 0.f)
continue;
if (w->m_bIsFullscreen || w->m_bIsFloating)
continue;
renderWindow(w.get(), pMonitor, time, true, RENDER_PASS_ALL);
}
// and floating ones too
for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_iWorkspaceID != pMonitor->activeWorkspace)
continue;
if (w->m_fAlpha.fl() == 0.f)
continue;
if (w->m_bIsFullscreen || !w->m_bIsFloating)
continue;
renderWindow(w.get(), pMonitor, time, true, RENDER_PASS_ALL);
}
for (auto& w : g_pCompositor->m_vWindows) { for (auto& w : g_pCompositor->m_vWindows) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(w->m_iWorkspaceID); const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(w->m_iWorkspaceID);
@ -141,7 +169,7 @@ void CHyprRenderer::renderWorkspaceWithFullscreenWindow(CMonitor* pMonitor, CWor
pWorkspaceWindow = w.get(); pWorkspaceWindow = w.get();
} }
// then render windows over fullscreen // then render windows over fullscreen.
for (auto& w : g_pCompositor->m_vWindows) { for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_iWorkspaceID != pWorkspaceWindow->m_iWorkspaceID || (!w->m_bCreatedOverFullscreen && !w->m_bPinned) || !w->m_bIsMapped) if (w->m_iWorkspaceID != pWorkspaceWindow->m_iWorkspaceID || (!w->m_bCreatedOverFullscreen && !w->m_bPinned) || !w->m_bIsMapped)
continue; continue;