mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
input: hold focus on mouse buttons
This commit is contained in:
@@ -2150,11 +2150,28 @@ void CCompositor::closeWindow(CWindow* pWindow) {
|
||||
}
|
||||
|
||||
SLayerSurface* CCompositor::getLayerSurfaceFromSurface(wlr_surface* pSurface) {
|
||||
std::pair<wlr_surface*, bool> result = {pSurface, false};
|
||||
|
||||
for (auto& m : m_vMonitors) {
|
||||
for (auto& lsl : m->m_aLayerSurfaceLayers) {
|
||||
for (auto& ls : lsl) {
|
||||
if (ls->layerSurface && ls->layerSurface->surface == pSurface)
|
||||
return ls.get();
|
||||
|
||||
static auto iter = [](wlr_surface* surf, int x, int y, void* data) -> void {
|
||||
if (surf == ((std::pair<wlr_surface*, bool>*)data)->first) {
|
||||
*(bool*)data = true;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if (!ls->layerSurface || !ls->mapped)
|
||||
continue;
|
||||
|
||||
wlr_surface_for_each_surface(ls->layerSurface->surface, iter, &result);
|
||||
|
||||
if (result.second)
|
||||
return ls.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user