From ad36a9dc9ed032e6e34c06f78995bca0045f85b0 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 27 Mar 2022 17:25:20 +0200 Subject: rework popups completely --- src/helpers/WLClasses.hpp | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'src/helpers/WLClasses.hpp') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 791e69f2..985e62af 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -4,6 +4,7 @@ #include "../defines.hpp" #include "../../wlr-layer-shell-unstable-v1-protocol.h" #include "../Window.hpp" +#include "SubsurfaceTree.hpp" struct SLayerSurface { wlr_layer_surface_v1* layerSurface; @@ -14,9 +15,9 @@ struct SLayerSurface { DYNLISTENER(unmapLayerSurface); DYNLISTENER(commitLayerSurface); DYNLISTENER(newPopup); - DYNLISTENER(newSubsurface); wlr_box geometry; + Vector2D position; zwlr_layer_shell_v1_layer layer; int monitorID = -1; @@ -28,22 +29,6 @@ struct SLayerSurface { } }; -struct SSubsurface { - wlr_subsurface* subsurface = nullptr; - SLayerSurface* pParentSurface = nullptr; - - DYNLISTENER(mapSubsurface); - DYNLISTENER(unmapSubsurface); - DYNLISTENER(destroySubsurface); - DYNLISTENER(commitSubsurface); - DYNLISTENER(newSubsurface); - - // For the list lookup - bool operator==(const SSubsurface& rhs) { - return subsurface == rhs.subsurface && pParentSurface == rhs.pParentSurface; - } -}; - struct SRenderData { wlr_output* output; timespec* when; @@ -68,26 +53,9 @@ struct SKeyboard { } }; -struct SLayerPopup { - wlr_xdg_popup* popup = nullptr; - SLayerSurface* parentSurface = nullptr; - wlr_xdg_popup* parentPopup = nullptr; - - DYNLISTENER(mapPopup); - DYNLISTENER(destroyPopup); - DYNLISTENER(unmapPopup); - DYNLISTENER(commitPopup); - DYNLISTENER(newPopupFromPopup); - - // For the list lookup - bool operator==(const SLayerPopup& rhs) { - return popup == rhs.popup; - } -}; - struct SXDGPopup { CWindow* parentWindow = nullptr; - wlr_xdg_popup* parentPopup = nullptr; + SXDGPopup* parentPopup = nullptr; wlr_xdg_popup* popup = nullptr; DYNLISTENER(newPopupFromPopupXDG); @@ -95,6 +63,11 @@ struct SXDGPopup { DYNLISTENER(mapPopupXDG); DYNLISTENER(unmapPopupXDG); + double* lx; + double* ly; + + SSurfaceTreeNode* pSurfaceTree = nullptr; + // For the list lookup bool operator==(const SXDGPopup& rhs) { return popup == rhs.popup; -- cgit v1.2.3