diff --git a/src/layers.cpp b/src/layers.cpp index 70403ae642..1f7933c775 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -490,8 +490,8 @@ static Layer layerForClient(const X11Client *client) } else if (member->screen() != client->screen()) { continue; } - if (member->layer() > layer) { - layer = member->layer(); + if (member->layer() == ActiveLayer) { + return ActiveLayer; } } }