summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-25 16:20:30 +0000
committerVaxry <vaxry@vaxry.net>2024-03-25 16:20:30 +0000
commitae17e900e720430c7848faf1b6e21b5f352c26ca (patch)
tree32b2a0e96a78f3c487f9d2bad96492bc6fb49719 /src/Compositor.cpp
parentca17a89d86b73f37019c4cc0c7087303adbcc1f9 (diff)
layer-shell: render popups above everything
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index bf6c4200..2d6e7856 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1143,13 +1143,34 @@ bool CCompositor::windowValidMapped(CWindow* pWindow) {
return true;
}
+wlr_surface* CCompositor::vectorToLayerPopupSurface(const Vector2D& pos, CMonitor* monitor, Vector2D* sCoords, SLayerSurface** ppLayerSurfaceFound) {
+ for (auto& lsl : monitor->m_aLayerSurfaceLayers | std::views::reverse) {
+ for (auto& ls : lsl | std::views::reverse) {
+ if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->surface->mapped) || ls->alpha.value() == 0.f)
+ continue;
+
+ auto SURFACEAT = wlr_layer_surface_v1_popup_surface_at(ls->layerSurface, pos.x - ls->geometry.x, pos.y - ls->geometry.y, &sCoords->x, &sCoords->y);
+
+ if (SURFACEAT) {
+ if (!pixman_region32_not_empty(&SURFACEAT->input_region))
+ continue;
+
+ *ppLayerSurfaceFound = ls.get();
+ return SURFACEAT;
+ }
+ }
+ }
+
+ return nullptr;
+}
+
wlr_surface* CCompositor::vectorToLayerSurface(const Vector2D& pos, std::vector<std::unique_ptr<SLayerSurface>>* layerSurfaces, Vector2D* sCoords,
SLayerSurface** ppLayerSurfaceFound) {
for (auto& ls : *layerSurfaces | std::views::reverse) {
if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->surface->mapped) || ls->alpha.value() == 0.f)
continue;
- auto SURFACEAT = wlr_layer_surface_v1_surface_at(ls->layerSurface, pos.x - ls->geometry.x, pos.y - ls->geometry.y, &sCoords->x, &sCoords->y);
+ auto SURFACEAT = wlr_surface_surface_at(ls->layerSurface->surface, pos.x - ls->geometry.x, pos.y - ls->geometry.y, &sCoords->x, &sCoords->y);
if (SURFACEAT) {
if (!pixman_region32_not_empty(&SURFACEAT->input_region))