[Development] NSMenu validation, QCocoaMenu and button (context etc) menus

René J.V. Bertin rjvbertin at gmail.com
Wed Aug 30 18:32:10 CEST 2017


Hi,

I ran into and reported a CPU burning issue a couple of days back, which was quickly resolved. It intrigued me why an application that doesn't use native Mac menus at all would be calling [NSMenu update] at all. 

I now know that the menu which triggered the scheduled NSMenu update is one that is attached to a button but that is also installed as the Dock menu. I guess that explains why its QMenu items have corresponding QCocoaMenu items.

If [NSMenu update] is expensive, is it certain that it's only being called when required, i.e. only for menus attached to the native menubar or possibly the application's dock tile? 

R.

On Tuesday August 29 2017 02:02:59 Gabriel de Dietrich wrote:
> FYI: QCocoaMenu: Stop update timer (Merged)<https://codereview.qt-project.org/203791>
> 
> Best regards,
> 
> Dr. Gabriel de Dietrich
> Senior Software Developer
> The Qt Company
> 
> On Aug 29, 2017, at 9:00 AM, Thiago Macieira <thiago.macieira at intel.com<mailto:thiago.macieira at intel.com>> wrote:
> 
> On Monday, 28 August 2017 17:06:18 PDT René J.V. Bertin wrote:
>        killTimer(m_updateTimer);
> 
> before setting m_updateTimer=0? Whether or not it's appropriate, this does
> solve the CPU burning for me.
> 
> Yeah, if you don't kill the timer, it will keep firing.
> 
> --
> Thiago Macieira - thiago.macieira (AT) intel.com<http://intel.com>
>  Software Architect - Intel Open Source Technology Center
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org<mailto:Development at qt-project.org>
> http://lists.qt-project.org/mailman/listinfo/development
> 




More information about the Development mailing list