diff options
author | vaxerski <[email protected]> | 2022-08-10 08:51:59 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-10 08:51:59 +0200 |
commit | c043bcdee6b895c5442d16a0c3f275ee7fe1beb4 (patch) | |
tree | 8c7b6943192bdd178d7cfefc1b72e1e3db4f6afd /src | |
parent | 8e5985d70e3370bc2c6155b58488499d5f6f067d (diff) | |
download | Hyprland-c043bcdee6b895c5442d16a0c3f275ee7fe1beb4.tar.gz Hyprland-c043bcdee6b895c5442d16a0c3f275ee7fe1beb4.zip |
fixes to toplevel updates
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 1adda1a0..926d2da6 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -173,7 +173,8 @@ void CWindow::updateToplevel() { wlr_foreign_toplevel_handle_v1_set_fullscreen(m_phForeignToplevel, m_bIsFullscreen); if (m_iLastToplevelMonitorID != m_iMonitorID) { - wlr_foreign_toplevel_handle_v1_output_leave(m_phForeignToplevel, g_pCompositor->getMonitorFromID(m_iLastToplevelMonitorID)->output); + if (const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iLastToplevelMonitorID); PMONITOR && PMONITOR->m_bEnabled) + wlr_foreign_toplevel_handle_v1_output_leave(m_phForeignToplevel, PMONITOR->output); wlr_foreign_toplevel_handle_v1_output_enter(m_phForeignToplevel, g_pCompositor->getMonitorFromID(m_iMonitorID)->output); m_iLastToplevelMonitorID = m_iMonitorID; @@ -191,7 +192,7 @@ void sendLeaveIter(wlr_surface* pSurface, int x, int y, void* data) { } void CWindow::updateSurfaceOutputs() { - if (m_iLastSurfaceMonitorID == m_iMonitorID) + if (m_iLastSurfaceMonitorID == m_iMonitorID || !m_bIsMapped || m_bHidden || !m_bMappedX11) return; const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_iLastSurfaceMonitorID); @@ -200,7 +201,7 @@ void CWindow::updateSurfaceOutputs() { const auto PNEWMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); - if (PLASTMONITOR) + if (PLASTMONITOR && PLASTMONITOR->m_bEnabled) wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendLeaveIter, PLASTMONITOR->output); wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(this), sendEnterIter, PNEWMONITOR->output); |