layerSurface: refactor/move to a memory-safe impl

Makes all the pointers smart to avoid memory issues
Refactors layerSurface code to live inside desktop/layersurface
This commit is contained in:
Vaxry 2024-04-30 02:41:27 +01:00
parent 5e6f7b1cdb
commit 5edc32930d
26 changed files with 874 additions and 864 deletions

View file

@ -4,13 +4,11 @@
#include <memory>
#include "Subsurface.hpp"
struct SLayerSurface;
class CPopup {
public:
// dummy head nodes
CPopup(PHLWINDOW pOwner);
CPopup(SLayerSurface* pOwner);
CPopup(PHLLS pOwner);
// real nodes
CPopup(wlr_xdg_popup* popup, CPopup* pOwner);
@ -35,8 +33,8 @@ class CPopup {
private:
// T1 owners, each popup has to have one of these
PHLWINDOWREF m_pWindowOwner;
SLayerSurface* m_pLayerOwner = nullptr;
PHLWINDOWREF m_pWindowOwner;
PHLLS m_pLayerOwner;
// T2 owners
CPopup* m_pParent = nullptr;