mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:05:59 +01:00
monitors: more guards for safety
This commit is contained in:
parent
0624455591
commit
928de33447
2 changed files with 16 additions and 2 deletions
|
@ -675,8 +675,10 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
||||
|
||||
// do the animation thing
|
||||
PWINDOW->m_vOriginalClosedPos = PWINDOW->m_vRealPosition.vec() - PMONITOR->vecPosition;
|
||||
PWINDOW->m_vOriginalClosedSize = PWINDOW->m_vRealSize.vec();
|
||||
if (PMONITOR) {
|
||||
PWINDOW->m_vOriginalClosedPos = PWINDOW->m_vRealPosition.vec() - PMONITOR->vecPosition;
|
||||
PWINDOW->m_vOriginalClosedSize = PWINDOW->m_vRealSize.vec();
|
||||
}
|
||||
|
||||
if (!PWINDOW->m_bX11DoesntWantBorders) // don't animate out if they weren't animated in.
|
||||
PWINDOW->m_vRealPosition = PWINDOW->m_vRealPosition.vec() + Vector2D(0.01f, 0.01f); // it has to be animated, otherwise onWindowPostCreateClose will ignore it
|
||||
|
|
|
@ -1074,6 +1074,10 @@ void CHyprOpenGLImpl::renderBorder(wlr_box* box, const CGradientValueData& grad,
|
|||
void CHyprOpenGLImpl::makeRawWindowSnapshot(CWindow* pWindow, CFramebuffer* pFramebuffer) {
|
||||
// we trust the window is valid.
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
||||
|
||||
if (!PMONITOR || !PMONITOR->output)
|
||||
return;
|
||||
|
||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||
|
||||
// we need to "damage" the entire monitor
|
||||
|
@ -1129,6 +1133,10 @@ void CHyprOpenGLImpl::makeRawWindowSnapshot(CWindow* pWindow, CFramebuffer* pFra
|
|||
void CHyprOpenGLImpl::makeWindowSnapshot(CWindow* pWindow) {
|
||||
// we trust the window is valid.
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
||||
|
||||
if (!PMONITOR || !PMONITOR->output)
|
||||
return;
|
||||
|
||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||
|
||||
// we need to "damage" the entire monitor
|
||||
|
@ -1189,6 +1197,10 @@ void CHyprOpenGLImpl::makeWindowSnapshot(CWindow* pWindow) {
|
|||
void CHyprOpenGLImpl::makeLayerSnapshot(SLayerSurface* pLayer) {
|
||||
// we trust the window is valid.
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pLayer->monitorID);
|
||||
|
||||
if (!PMONITOR || !PMONITOR->output)
|
||||
return;
|
||||
|
||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||
|
||||
// we need to "damage" the entire monitor
|
||||
|
|
Loading…
Reference in a new issue