Observe Compositor Changes in Widget

6 views
Skip to first unread message

Eric Sum

unread,
Jul 21, 2022, 1:33:12 PM7/21/22
to Graphics-dev
Hi,

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.

Thanks.

Sunny Sachanandani

unread,
Jul 21, 2022, 6:05:50 PM7/21/22
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

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