Opened 8 years ago

Last modified 8 years ago

#14562 new defect

100% CPU usage when using appmenu

Reported by: bdrung Owned by:
Priority: normal Milestone:
Component: wxGTK Version: oldstable-latest
Keywords: wxFrame::OnInternalIdle Unity ubuntu Cc:
Blocked By: Blocking:
Patch: no

Description

All wxWidgets applications have a 100 % CPU usage when they are executed under Unity (Ubuntu's default desktop environment). Unity uses appmenu to display the menus.

This bug is introduced by r67929.

The attached patch fixes the 100% CPU usage in Unity, but then the menus are missing when run under a non Unity desktop environment.

Attachments (1)

drop-appmenu-workaround.patch download (790 bytes) - added by bdrung 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by bdrung

comment:1 Changed 8 years ago by vadz

  • Keywords unity added

I don't understand at all how could the changes of r67929 result in 100% CPU usage, could you please explain what's going on here?

In any case, breaking all "normal" desktops is clearly not acceptable.

Finally, would you be able to test the behaviour of 2.9.4 under Unity by chance? TIA!

comment:2 follow-up: Changed 8 years ago by bdrung

Unity uses a global menu. The menu of an application is displayed in the top panel instead in the application window. That's why m_menuBarHeight will always return 0 when Unity is used. Therefore if (!m_menuBarHeight) will return true and UpdateMenuBarSize() will be called. UpdateMenuBarSize() calls GtkUpdateSize(). There will be a function call loop that causes 100% CPU usage.

I tried to compile Audacity against wxWidgets 2.9.4, but Audacity does not support this version yet. I tried to port Audacity to the newer API, but aborted this effort after several hours. Can you recommend an other application to test this menu bug?

comment:3 Changed 8 years ago by mmarsan

Sorry, I don't see 100% CPU usage in my Ubuntu 12.04 (Unity as default).

I use CodeBlocks, which is compiled against 2.8.12
Showing and using the menu takes about 30% CPU on my old AMD 3200.

A wx sample compiled with last SVN behaves the same, about 30% using the menu.

The gnome-system-monitor used to see % CPU uses about 9%. Codeblocks uses 5% (while doing nothing) and the rest up to 30% is < 1%.

comment:4 in reply to: ↑ 2 Changed 8 years ago by vadz

  • Keywords ubuntu added

Replying to bdrung:

Unity uses a global menu. The menu of an application is displayed in the top panel instead in the application window.

Yes but not always. This can be disabled in different ways (that you probably know better than me). There are many problems when using the global menu bar, even in 2.9 (see https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/1041888 for example) so at least in 2.8 I think the only way to make wx apps work at all in Ubuntu is by disabling the global menu for them. And I think your patch breaks even that.

BTW, I'd really like to fix the other Unity-specific bugs before 3.0 but I just have no idea how to do it, the menu model is just too broken^H^H^H^H^H^Hdifferent. We'd really appreciate help with this...

I tried to compile Audacity against wxWidgets 2.9.4, but Audacity does not support this version yet.

Strange, I seem to remember there was someone building it with 2.9 quite some time ago.

I tried to port Audacity to the newer API, but aborted this effort after several hours.

If you ran into any really difficult problems, please post to the list, we'd be glad to help.

Can you recommend an other application to test this menu bug?

Any wx sample, including the minimal one, should do.

comment:5 Changed 8 years ago by vadz

  • Keywords Unity added; unity removed

No changes, just standardizing on "Unity" tag.

Note: See TracTickets for help on using tickets.