diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-18 20:35:15 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-18 20:35:15 +0000 |
| commit | 250d61e0b3e23ed7088dd7a309b3a5b3a2d6577c (patch) | |
| tree | fe93b9c77423e2ec3cfce18ab1308da0a4df8434 /src/Compositor.cpp | |
| parent | ba05c43ae3cb680e5d728c5a7457cf6c3d333854 (diff) | |
find base surface if no subsurface found in ls
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 43bfbe78..581cf0fb 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -888,7 +888,11 @@ wlr_surface* CCompositor::vectorToLayerSurface(const Vector2D& pos, std::vector< if ((*it)->fadingOut || !(*it)->layerSurface || ((*it)->layerSurface && !(*it)->layerSurface->mapped) || (*it)->alpha.fl() == 0.f) continue; - const auto SURFACEAT = wlr_layer_surface_v1_surface_at((*it)->layerSurface, pos.x - (*it)->geometry.x, pos.y - (*it)->geometry.y, &sCoords->x, &sCoords->y); + auto SURFACEAT = wlr_layer_surface_v1_surface_at((*it)->layerSurface, pos.x - (*it)->geometry.x, pos.y - (*it)->geometry.y, &sCoords->x, &sCoords->y); + + if (!SURFACEAT && VECINRECT(pos, (*it)->geometry.x, (*it)->geometry.y, (*it)->geometry.x + (*it)->geometry.width, (*it)->geometry.y + (*it)->geometry.height)) { + SURFACEAT = (*it)->layerSurface->surface; + } if (SURFACEAT) { *ppLayerSurfaceFound = it->get(); |
