mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 04:10:04 +01:00
desktop/layer: store aboveFs property and use that
This commit is contained in:
parent
59438908de
commit
7098558420
7 changed files with 53 additions and 45 deletions
|
|
@ -2164,11 +2164,15 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, Desktop::Vie
|
|||
PWINDOW->updateDecorationValues();
|
||||
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PWINDOW->monitorID());
|
||||
|
||||
// make all windows on the same workspace under the fullscreen window
|
||||
// make all windows and layers on the same workspace under the fullscreen window
|
||||
for (auto const& w : m_windows) {
|
||||
if (w->m_workspace == PWORKSPACE && !w->isFullscreen() && !w->m_fadingOut && !w->m_pinned)
|
||||
w->m_createdOverFullscreen = false;
|
||||
}
|
||||
for (auto const& ls : m_layers) {
|
||||
if (ls->m_monitor == PMONITOR)
|
||||
ls->m_aboveFullscreen = false;
|
||||
}
|
||||
|
||||
g_pDesktopAnimationManager->setFullscreenFadeAnimation(
|
||||
PWORKSPACE, PWORKSPACE->m_hasFullscreenWindow ? CDesktopAnimationManager::ANIMATION_TYPE_IN : CDesktopAnimationManager::ANIMATION_TYPE_OUT);
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ void CLayerSurface::onMap() {
|
|||
|
||||
m_mapped = true;
|
||||
m_interactivity = m_layerSurface->m_current.interactivity;
|
||||
m_aboveFullscreen = true;
|
||||
|
||||
m_ruleApplicator->propertiesChanged(Desktop::Rule::RULE_PROP_ALL);
|
||||
|
||||
|
|
@ -330,23 +331,10 @@ void CLayerSurface::onCommit() {
|
|||
}
|
||||
}
|
||||
|
||||
// update alpha when window is in fullscreen
|
||||
auto PWORKSPACE = PMONITOR->m_activeSpecialWorkspace ? PMONITOR->m_activeSpecialWorkspace : PMONITOR->m_activeWorkspace;
|
||||
if (PWORKSPACE && PWORKSPACE->m_fullscreenMode == FSMODE_FULLSCREEN) {
|
||||
// warp if switching render layer so we don't see glitches and have clean fade
|
||||
if ((m_layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || m_layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM) &&
|
||||
(m_layerSurface->m_current.layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP || m_layerSurface->m_current.layer == ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY))
|
||||
m_alpha->setValueAndWarp(0.f);
|
||||
|
||||
// from overlay to top
|
||||
if (m_layer == ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY && m_layerSurface->m_current.layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP)
|
||||
*m_alpha = 0.f;
|
||||
// to overlay
|
||||
if (m_layerSurface->m_current.layer == ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY)
|
||||
*m_alpha = 1.f;
|
||||
}
|
||||
|
||||
m_layer = m_layerSurface->m_current.layer;
|
||||
m_aboveFullscreen = true;
|
||||
|
||||
g_pDesktopAnimationManager->setFullscreenFadeAnimation(PMONITOR->m_activeWorkspace, CDesktopAnimationManager::ANIMATION_TYPE_IN);
|
||||
|
||||
if (m_layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || m_layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM)
|
||||
g_pHyprOpenGL->markBlurDirtyForMonitor(PMONITOR); // so that blur is recalc'd
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ namespace Desktop::View {
|
|||
bool m_fadingOut = false;
|
||||
bool m_readyToDelete = false;
|
||||
bool m_noProcess = false;
|
||||
bool m_aboveFullscreen = true;
|
||||
|
||||
UP<Desktop::Rule::CLayerRuleApplicator> m_ruleApplicator;
|
||||
|
||||
|
|
|
|||
|
|
@ -1318,6 +1318,12 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo
|
|||
EMIT_HOOK_EVENT("workspace", pWorkspace);
|
||||
}
|
||||
|
||||
// set all LSes as not above fullscreen on workspace changes
|
||||
for (auto const& ls : g_pCompositor->m_layers) {
|
||||
if (ls->m_monitor == m_self)
|
||||
ls->m_aboveFullscreen = false;
|
||||
}
|
||||
|
||||
pWorkspace->m_events.activeChanged.emit();
|
||||
|
||||
g_pHyprRenderer->damageMonitor(m_self.lock());
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ void CDesktopAnimationManager::setFullscreenFadeAnimation(PHLWORKSPACE ws, eAnim
|
|||
|
||||
if (ws->m_id == PMONITOR->activeWorkspaceID() || ws->m_id == PMONITOR->activeSpecialWorkspaceID()) {
|
||||
for (auto const& ls : PMONITOR->m_layerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
|
||||
if (!ls->m_fadingOut)
|
||||
if (!ls->m_fadingOut && !ls->m_aboveFullscreen)
|
||||
*ls->m_alpha = FULLSCREEN && ws->m_fullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,7 +402,15 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st
|
|||
// then, we check if the workspace doesn't have a fullscreen window
|
||||
const auto PWORKSPACE = PMONITOR->m_activeSpecialWorkspace ? PMONITOR->m_activeSpecialWorkspace : PMONITOR->m_activeWorkspace;
|
||||
const auto PWINDOWIDEAL = g_pCompositor->vectorToWindowUnified(mouseCoords, Desktop::View::RESERVED_EXTENTS | Desktop::View::INPUT_EXTENTS | Desktop::View::ALLOW_FLOATING);
|
||||
if (PWORKSPACE->m_hasFullscreenWindow && !foundSurface && PWORKSPACE->m_fullscreenMode == FSMODE_FULLSCREEN) {
|
||||
if (PWORKSPACE->m_hasFullscreenWindow && PWORKSPACE->m_fullscreenMode == FSMODE_FULLSCREEN) {
|
||||
const auto IS_LS_UNFOCUSABLE = pFoundLayerSurface &&
|
||||
(pFoundLayerSurface->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP ||
|
||||
(pFoundLayerSurface->m_layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP && !pFoundLayerSurface->m_aboveFullscreen));
|
||||
|
||||
if (IS_LS_UNFOCUSABLE) {
|
||||
foundSurface = nullptr;
|
||||
pFoundLayerSurface = nullptr;
|
||||
|
||||
pFoundWindow = PWORKSPACE->getFullscreenWindow();
|
||||
|
||||
if (!pFoundWindow) {
|
||||
|
|
@ -424,6 +432,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st
|
|||
surfacePos = pFoundWindow->m_realPosition->value();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// then windows
|
||||
if (!foundSurface) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue