MCPcopy Create free account
hub / github.com/canonical/mir / add_observer

Method add_observer

src/server/scene/surface_stack.cpp:566–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566void ms::SurfaceStack::add_observer(std::shared_ptr<ms::Observer> const& observer)
567{
568 observers.add(observer);
569
570 // Notify observer of existing surfaces.
571 //
572 // The surfaces are sent with the most-recently focused first and the
573 // least-recently focused last.
574 RecursiveReadLock lk(guard);
575 for (auto const& surface : std::ranges::reverse_view(focus_order))
576 {
577 if (auto const locked = surface.lock())
578 observer->surface_exists(locked);
579 }
580}
581
582void ms::SurfaceStack::remove_observer(std::weak_ptr<ms::Observer> const& observer)
583{

Callers 7

XWaylandWMMethod · 0.45
WlSeatMethod · 0.45
startMethod · 0.45

Calls 3

addMethod · 0.45
lockMethod · 0.45
surface_existsMethod · 0.45

Tested by

no test coverage detected