diff options
author | vaxerski <[email protected]> | 2022-03-31 21:58:33 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-03-31 21:58:33 +0200 |
commit | 7ec2aed55f35a56d40a9a833ef0700574ab2dd39 (patch) | |
tree | 9c2e10c008efba68f49f7898d0c5263c9335b1f2 /src/events/Popups.cpp | |
parent | 51dfc0f9c917fd6fcb4e5b5c0639d34392e8067b (diff) | |
download | Hyprland-7ec2aed55f35a56d40a9a833ef0700574ab2dd39.tar.gz Hyprland-7ec2aed55f35a56d40a9a833ef0700574ab2dd39.zip |
More checks in popups
Diffstat (limited to 'src/events/Popups.cpp')
-rw-r--r-- | src/events/Popups.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp index 90e0851d..6cc6a34e 100644 --- a/src/events/Popups.cpp +++ b/src/events/Popups.cpp @@ -58,6 +58,8 @@ void createNewPopup(wlr_xdg_popup* popup, SXDGPopup* pHyprPopup) { void Events::listener_newPopup(void* owner, void* data) { SLayerSurface* layersurface = (SLayerSurface*)owner; + ASSERT(layersurface); + Debug::log(LOG, "New layer popup created from surface %x", layersurface); const auto WLRPOPUP = (wlr_xdg_popup*)data; @@ -74,6 +76,8 @@ void Events::listener_newPopup(void* owner, void* data) { void Events::listener_newPopupXDG(void* owner, void* data) { CWindow* PWINDOW = (CWindow*)owner; + ASSERT(PWINDOW); + Debug::log(LOG, "New layer popup created from XDG window %x -> %s", PWINDOW, PWINDOW->m_szTitle.c_str()); const auto WLRPOPUP = (wlr_xdg_popup*)data; @@ -91,7 +95,12 @@ void Events::listener_newPopupXDG(void* owner, void* data) { void Events::listener_newPopupFromPopupXDG(void* owner, void* data) { SXDGPopup* PPOPUP = (SXDGPopup*)owner; - Debug::log(LOG, "New layer popup created from XDG popup %x -> %s", PPOPUP, PPOPUP->parentWindow->m_szTitle.c_str()); + ASSERT(PPOPUP); + + if (PPOPUP->parentWindow) + Debug::log(LOG, "New popup created from XDG Window popup %x -> %s", PPOPUP, PPOPUP->parentWindow->m_szTitle.c_str()); + else + Debug::log(LOG, "New popup created from Non-Window popup %x", PPOPUP); const auto WLRPOPUP = (wlr_xdg_popup*)data; @@ -102,6 +111,7 @@ void Events::listener_newPopupFromPopupXDG(void* owner, void* data) { PNEWPOPUP->parentPopup = PPOPUP; PNEWPOPUP->lx = PPOPUP->lx; PNEWPOPUP->ly = PPOPUP->ly; + PNEWPOPUP->parentWindow = PPOPUP->parentWindow; createNewPopup(WLRPOPUP, PNEWPOPUP); } @@ -109,6 +119,8 @@ void Events::listener_newPopupFromPopupXDG(void* owner, void* data) { void Events::listener_mapPopupXDG(void* owner, void* data) { SXDGPopup* PPOPUP = (SXDGPopup*)owner; + ASSERT(PPOPUP); + Debug::log(LOG, "New XDG Popup mapped"); PPOPUP->pSurfaceTree = SubsurfaceTree::createTreeRoot(PPOPUP->popup->base->surface, addPopupGlobalCoords, PPOPUP); @@ -120,6 +132,8 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) { SXDGPopup* PPOPUP = (SXDGPopup*)owner; Debug::log(LOG, "XDG Popup unmapped"); + ASSERT(PPOPUP); + SubsurfaceTree::destroySurfaceTree(PPOPUP->pSurfaceTree); PPOPUP->pSurfaceTree = nullptr; @@ -128,6 +142,8 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) { void Events::listener_destroyPopupXDG(void* owner, void* data) { SXDGPopup* PPOPUP = (SXDGPopup*)owner; + ASSERT(PPOPUP); + Debug::log(LOG, "Destroyed popup XDG %x", PPOPUP); if (PPOPUP->pSurfaceTree) { |