Observe Compositor Changes in Widget

Skip to first unread message

Eric Sum

Jul 21, 2022, 1:33:12 PMJul 21
to Graphics-dev

The comment above Widget::GetCompositor() says:

// Returns the compositor for this Widget, note that this may change during
// the Widget's lifetime (e.g. when switching monitors on Chrome OS).

Is there any way for an external observer (an ordinary class that doesn't inherit from Widget or View) to know when a Widget's Compositor does change, aside from polling GetCompositor()? I may have missed something in the API when I checked; sorry if so.


Sunny Sachanandani

Jul 21, 2022, 6:05:50 PMJul 21
to Eric Sum, Graphics-dev
I can't answer definitively, but maybe you could register as a CompositorObserver with the ui::Compositor and do something when OnCompositingShuttingDown() callback fires? Someone more knowledgeable with UI compositing can say for sure.

Eric Sum

Jul 22, 2022, 4:30:31 PMJul 22
to Sunny Sachanandani, Graphics-dev
I see. Thanks for getting back to me! I'll try this out.
Reply all
Reply to author
0 new messages