mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-14 19:45:45 -07:00
desktop: move popups to UPs and fix missing subsurface resource
fixes #9283
This commit is contained in:
@@ -59,7 +59,7 @@ class CLayerSurface {
|
|||||||
CBox geometry = {0, 0, 0, 0};
|
CBox geometry = {0, 0, 0, 0};
|
||||||
Vector2D position;
|
Vector2D position;
|
||||||
std::string szNamespace = "";
|
std::string szNamespace = "";
|
||||||
SP<CPopup> popupHead;
|
UP<CPopup> popupHead;
|
||||||
|
|
||||||
void onDestroy();
|
void onDestroy();
|
||||||
void onMap();
|
void onMap();
|
||||||
|
@@ -12,24 +12,24 @@
|
|||||||
#include "../render/OpenGL.hpp"
|
#include "../render/OpenGL.hpp"
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
|
||||||
SP<CPopup> CPopup::create(PHLWINDOW pOwner) {
|
UP<CPopup> CPopup::create(PHLWINDOW pOwner) {
|
||||||
auto popup = SP<CPopup>(new CPopup());
|
auto popup = UP<CPopup>(new CPopup());
|
||||||
popup->m_pWindowOwner = pOwner;
|
popup->m_pWindowOwner = pOwner;
|
||||||
popup->m_pSelf = popup;
|
popup->m_pSelf = popup;
|
||||||
popup->initAllSignals();
|
popup->initAllSignals();
|
||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
SP<CPopup> CPopup::create(PHLLS pOwner) {
|
UP<CPopup> CPopup::create(PHLLS pOwner) {
|
||||||
auto popup = SP<CPopup>(new CPopup());
|
auto popup = UP<CPopup>(new CPopup());
|
||||||
popup->m_pLayerOwner = pOwner;
|
popup->m_pLayerOwner = pOwner;
|
||||||
popup->m_pSelf = popup;
|
popup->m_pSelf = popup;
|
||||||
popup->initAllSignals();
|
popup->initAllSignals();
|
||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
SP<CPopup> CPopup::create(SP<CXDGPopupResource> resource, WP<CPopup> pOwner) {
|
UP<CPopup> CPopup::create(SP<CXDGPopupResource> resource, WP<CPopup> pOwner) {
|
||||||
auto popup = SP<CPopup>(new CPopup());
|
auto popup = UP<CPopup>(new CPopup());
|
||||||
popup->m_pResource = resource;
|
popup->m_pResource = resource;
|
||||||
popup->m_pWindowOwner = pOwner->m_pWindowOwner;
|
popup->m_pWindowOwner = pOwner->m_pWindowOwner;
|
||||||
popup->m_pLayerOwner = pOwner->m_pLayerOwner;
|
popup->m_pLayerOwner = pOwner->m_pLayerOwner;
|
||||||
@@ -282,7 +282,8 @@ void CPopup::recheckTree() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CPopup::recheckChildrenRecursive() {
|
void CPopup::recheckChildrenRecursive() {
|
||||||
auto cpy = m_vChildren;
|
std::vector<WP<CPopup>> cpy;
|
||||||
|
std::ranges::for_each(m_vChildren, [&cpy](const auto& el) { cpy.emplace_back(el); });
|
||||||
for (auto const& c : cpy) {
|
for (auto const& c : cpy) {
|
||||||
c->onCommit(true);
|
c->onCommit(true);
|
||||||
c->recheckChildrenRecursive();
|
c->recheckChildrenRecursive();
|
||||||
|
@@ -10,11 +10,11 @@ class CXDGPopupResource;
|
|||||||
class CPopup {
|
class CPopup {
|
||||||
public:
|
public:
|
||||||
// dummy head nodes
|
// dummy head nodes
|
||||||
static SP<CPopup> create(PHLWINDOW pOwner);
|
static UP<CPopup> create(PHLWINDOW pOwner);
|
||||||
static SP<CPopup> create(PHLLS pOwner);
|
static UP<CPopup> create(PHLLS pOwner);
|
||||||
|
|
||||||
// real nodes
|
// real nodes
|
||||||
static SP<CPopup> create(SP<CXDGPopupResource> popup, WP<CPopup> pOwner);
|
static UP<CPopup> create(SP<CXDGPopupResource> popup, WP<CPopup> pOwner);
|
||||||
|
|
||||||
~CPopup();
|
~CPopup();
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class CPopup {
|
|||||||
bool m_bInert = false;
|
bool m_bInert = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
std::vector<SP<CPopup>> m_vChildren;
|
std::vector<UP<CPopup>> m_vChildren;
|
||||||
UP<CSubsurface> m_pSubsurfaceHead;
|
UP<CSubsurface> m_pSubsurfaceHead;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@@ -29,6 +29,7 @@ UP<CSubsurface> CSubsurface::create(WP<CPopup> pOwner) {
|
|||||||
UP<CSubsurface> CSubsurface::create(SP<CWLSubsurfaceResource> pSubsurface, PHLWINDOW pOwner) {
|
UP<CSubsurface> CSubsurface::create(SP<CWLSubsurfaceResource> pSubsurface, PHLWINDOW pOwner) {
|
||||||
auto subsurface = UP<CSubsurface>(new CSubsurface());
|
auto subsurface = UP<CSubsurface>(new CSubsurface());
|
||||||
subsurface->m_pWindowParent = pOwner;
|
subsurface->m_pWindowParent = pOwner;
|
||||||
|
subsurface->m_pSubsurface = pSubsurface;
|
||||||
subsurface->m_pSelf = subsurface;
|
subsurface->m_pSelf = subsurface;
|
||||||
subsurface->m_pWLSurface = CWLSurface::create();
|
subsurface->m_pWLSurface = CWLSurface::create();
|
||||||
subsurface->m_pWLSurface->assign(pSubsurface->surface.lock(), subsurface.get());
|
subsurface->m_pWLSurface->assign(pSubsurface->surface.lock(), subsurface.get());
|
||||||
@@ -40,6 +41,7 @@ UP<CSubsurface> CSubsurface::create(SP<CWLSubsurfaceResource> pSubsurface, PHLWI
|
|||||||
UP<CSubsurface> CSubsurface::create(SP<CWLSubsurfaceResource> pSubsurface, WP<CPopup> pOwner) {
|
UP<CSubsurface> CSubsurface::create(SP<CWLSubsurfaceResource> pSubsurface, WP<CPopup> pOwner) {
|
||||||
auto subsurface = UP<CSubsurface>(new CSubsurface());
|
auto subsurface = UP<CSubsurface>(new CSubsurface());
|
||||||
subsurface->m_pPopupParent = pOwner;
|
subsurface->m_pPopupParent = pOwner;
|
||||||
|
subsurface->m_pSubsurface = pSubsurface;
|
||||||
subsurface->m_pSelf = subsurface;
|
subsurface->m_pSelf = subsurface;
|
||||||
subsurface->m_pWLSurface = CWLSurface::create();
|
subsurface->m_pWLSurface = CWLSurface::create();
|
||||||
subsurface->m_pWLSurface->assign(pSubsurface->surface.lock(), subsurface.get());
|
subsurface->m_pWLSurface->assign(pSubsurface->surface.lock(), subsurface.get());
|
||||||
|
@@ -298,7 +298,7 @@ class CWindow {
|
|||||||
|
|
||||||
// desktop components
|
// desktop components
|
||||||
UP<CSubsurface> m_pSubsurfaceHead;
|
UP<CSubsurface> m_pSubsurfaceHead;
|
||||||
SP<CPopup> m_pPopupHead;
|
UP<CPopup> m_pPopupHead;
|
||||||
|
|
||||||
// Animated border
|
// Animated border
|
||||||
CGradientValueData m_cRealBorderColor = {0};
|
CGradientValueData m_cRealBorderColor = {0};
|
||||||
|
Reference in New Issue
Block a user