mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-14 23:38:22 +00:00
protocols: Support wp color management proto (#9444)
Adds support for the recently merged w-p CM protocol alongside the (now deprecated) old CM WIP protocols
This commit is contained in:
@@ -306,6 +306,23 @@ void CWLSurfaceResource::breadthfirst(std::function<void(SP<CWLSurfaceResource>,
|
||||
bfHelper(surfs, fn, data);
|
||||
}
|
||||
|
||||
SP<CWLSurfaceResource> CWLSurfaceResource::findFirstPreorderHelper(SP<CWLSurfaceResource> root, std::function<bool(SP<CWLSurfaceResource>)> fn) {
|
||||
if (fn(root))
|
||||
return root;
|
||||
for (auto const& sub : root->subsurfaces) {
|
||||
if (sub.expired() || sub->surface.expired())
|
||||
continue;
|
||||
const auto found = findFirstPreorderHelper(sub->surface.lock(), fn);
|
||||
if (found)
|
||||
return found;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SP<CWLSurfaceResource> CWLSurfaceResource::findFirstPreorder(std::function<bool(SP<CWLSurfaceResource>)> fn) {
|
||||
return findFirstPreorderHelper(self.lock(), fn);
|
||||
}
|
||||
|
||||
std::pair<SP<CWLSurfaceResource>, Vector2D> CWLSurfaceResource::at(const Vector2D& localCoords, bool allowsInput) {
|
||||
std::vector<std::pair<SP<CWLSurfaceResource>, Vector2D>> surfs;
|
||||
breadthfirst([&surfs](SP<CWLSurfaceResource> surf, const Vector2D& offset, void* data) { surfs.emplace_back(std::make_pair<>(surf, offset)); }, &surfs);
|
||||
|
Reference in New Issue
Block a user