Skip to content

Commit

Permalink
find surfaces in reverse for focus
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Jun 10, 2022
1 parent 3a2ac11 commit dc5cc15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,11 @@ CWindow* CCompositor::getWindowForPopup(wlr_xdg_popup* popup) {
}

wlr_surface* CCompositor::vectorToLayerSurface(const Vector2D& pos, std::list<SLayerSurface*>* layerSurfaces, Vector2D* sCoords) {
for (auto& l : *layerSurfaces) {
if (l->fadingOut || (l->layerSurface && !l->layerSurface->mapped))
for (auto it = layerSurfaces->rbegin(); it != layerSurfaces->rend(); it++) {
if ((*it)->fadingOut || !(*it)->layerSurface || ((*it)->layerSurface && !(*it)->layerSurface->mapped))
continue;

const auto SURFACEAT = wlr_layer_surface_v1_surface_at(l->layerSurface, pos.x - l->geometry.x, pos.y - l->geometry.y, &sCoords->x, &sCoords->y);
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);

if (SURFACEAT)
return SURFACEAT;
Expand Down

0 comments on commit dc5cc15

Please sign in to comment.