From bcb02b9307d09918a11fa377065d7f2c6e506754 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 21 Mar 2022 16:13:43 +0100 Subject: handle subsurfaces --- src/helpers/Monitor.hpp | 1 + src/helpers/WLClasses.hpp | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp index 0977b1f8..b3f10893 100644 --- a/src/helpers/Monitor.hpp +++ b/src/helpers/Monitor.hpp @@ -23,6 +23,7 @@ struct SMonitor { // WLR stuff wlr_output* output = nullptr; float refreshRate = 60; + wlr_output_damage* damage = nullptr; // Double-linked list because we need to have constant mem addresses for signals // We have to store pointers and use raw new/delete because they might be moved between them diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 8d7dcede..c37bf5a5 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -14,6 +14,7 @@ struct SLayerSurface { DYNLISTENER(unmapLayerSurface); DYNLISTENER(commitLayerSurface); DYNLISTENER(newPopup); + DYNLISTENER(newSubsurface); wlr_box geometry; zwlr_layer_shell_v1_layer layer; @@ -27,11 +28,31 @@ 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; - int x; - int y; + int x, y; + + // for iters + void* data = nullptr; + wlr_surface* surface = nullptr; + int w, h; }; struct SKeyboard { -- cgit v1.2.3