Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Globalmenu consumes 100% CPU and does not work #8455
Comments
MarshallOfSound
added
the
linux-distribution-specific
label
Jan 20, 2017
KottV
commented
Feb 4, 2017
|
Confirm that on openSUSE TW with Plasma 5.9 |
groundwater
added
the
triaged/bug
label
Feb 4, 2017
groundwater
assigned
kevinsawicki
Feb 4, 2017
XavierCLL
commented
Feb 8, 2017
|
Confirmed bug with the last stable version of electron, I add additional information, when I click on menubar in
|
ChALkeR
commented
Feb 11, 2017
•
|
Related:
The patch to libdbusmenu-qt (or the one at KDE Phabricator) should fix the |
ChALkeR
commented
Feb 11, 2017
•
|
@XavierCLL I updated to Plasma Workspace 5.9.1 which includes the two patches from KDE Phabricator above (D4088 and D3926) Upd: ah, sorry, no, the warning is not gone, I was mistaken. Perhaps it's worth to take a closer look there =). |
ChALkeR
referenced this issue
in mattermost/mattermost-server
Feb 11, 2017
Closed
Mattermost continuously updates its application menu without need #5088
ChALkeR
commented
Feb 11, 2017
|
mattermost/platform#5088 has some more technical info. Also, from IRC logs with @kbroulik:
|
ChALkeR
commented
Feb 11, 2017
|
@kevinsawicki, are you able to reproduce the continuous dbus spam with |
ChALkeR
commented
Feb 11, 2017
•
|
@kbroulik, btw, the mattermost code you cited in mattermost/platform#5088 is not the culpit here — in fact in fires This simple testcase executed once shows the same behaviour with lots of traffic being sent via dbus: const template = [
{
label: 'Edit',
submenu: [ { role: 'undo' } ]
}
];
const menu = electron.Menu.buildFromTemplate(template);
electron.Menu.setApplicationMenu(menu);https://github.com/electron/electron/blob/master/atom/browser/ui/views/global_menu_bar_x11.cc is source for Electron dbusmenu client. Those lines look relevant: https://github.com/electron/electron/blob/master/atom/browser/ui/views/global_menu_bar_x11.cc#L240-L242, based on looped Probably /cc @zcbenz. Note that |
ChALkeR
commented
Feb 11, 2017
|
A shortened version of what is going on (without reply times and arguments):
Those messages are constantly being looped. |
ChALkeR
commented
Feb 12, 2017
•
|
Ok, more details on what is happening here:
It could be seen that @kbroulik, @kevinsawicki, @zcbenz, PTAL =). Upd: the issues seems to be not reproducible with Electron + Unity, so this depends on the handler of the dbusmenu on the DE side and is KDE-specific. |
ChALkeR
commented
Feb 14, 2017
|
Does electron need to emit |
cribari
commented
Feb 15, 2017
|
Today I filed this KDE Plasma bub report: https://bugs.kde.org/show_bug.cgi?id=376517 |
ChALkeR
commented
Feb 15, 2017
cribari
commented
Feb 15, 2017
|
I am having this problem with wmail: https://github.com/Thomas101/wmail/issues/584 |
ChALkeR
commented
Feb 16, 2017
|
A related KDE bugreport (closed as upstream, meaning Electron): https://bugs.kde.org/show_bug.cgi?id=376476. |
10tion
commented
Feb 20, 2017
|
Have this problem on plasma 5.9.2, manjaro, too. Full cpu usage and cannot operate on all electron apps: messenger, vscode, atom. |
ChALkeR
commented
Feb 20, 2017
•
|
@kevinsawicki Perhaps this part: global_menu_bar_x11.cc#L310-L316 shouldn't be run if the submenu wasn't changed. I'm not familar with that code, but it seems to me that a straighforward hack could be to serialize |
kevinsawicki
added
the
platform/linux
label
Feb 21, 2017
But what if there are updates each time? Electron allows dynamic labels and say an application wants a menu label that shows the time in it or some other changing/dynamic value. If |
ChALkeR
commented
Feb 22, 2017
•
What exact updates? To me it looks like electron doesn't check if the current contents of the menu are the same as the contents it wants to set when handling See testcase in #8455 (comment) — even that simple testcases causes the loop here. If there would be any actual updates to the menu model at some point, |
ChALkeR
changed the title from
Globalmenu eats 100% CPU and does not work
to
Globalmenu consumes 100% CPU and does not work
Feb 22, 2017
The updates to the menu from the application. Properties like
Yeah, I can definitely reproduce this, just trying to figure out the best fix. |
rsese
referenced this issue
in atom/atom
Feb 27, 2017
Closed
Menus not working in plasma 5.9 with global menu enabled #13885
AfroMetal
commented
Mar 10, 2017
|
I can confirm. Manjaro, KDE Plasma 5.9.3. Menu is laggy in Atom, I had to turn off global menu because of it (I love Atom more than Global Menu, but still would be nice to have both). |
mattdrzazga
commented
Mar 11, 2017
|
I can confirm too. Slack and Gitkraken are consuming CPU like there is no tomorrow. I'm on Antergos with plasma 5.9.3. |
wintericie
commented
Mar 14, 2017
|
I can confirm this issue on Kubuntu 16.04.2 with Plasma 5.9.3 from kubuntu-ci PPA. The CPU usage is 100% when using VSCode, Atom and Franz. Tons of logs from dbus-monitor are found just like in the post from @ChALkeR. |
michaldybczak
commented
Mar 22, 2017
|
I confirm the issue on manjaro plasma Plasma 5.9.3-4. Both: global menu is not clickable and CPU spikes when doing nothing, just by opening Atom with global menu. |
andreyorst
commented
Mar 30, 2017
|
Manjaro plasma 5.9.3. Global menu is clickable at some times. If you will rapidly clicking continuously it will open at some moment, but actions are not usable at all. This makes any electron app absolutely unusable. Is there any chance of fix? I don't want to turn globalmenu off, but i need those electron apps. Possible workaround is to open app from different user, which don't have globalmenu set on, but it is kinda weird. |
mattdrzazga
commented
Apr 4, 2017
|
@andreyorst |
michaldybczak
commented
Apr 5, 2017
|
Thanks, this workaround works not only for elektron apps. I used it successfully on messengerfordesktop that has also the same bug. |
cirelli94
commented
Apr 6, 2017
|
To me the global menu is still working but it use 100% of a cpu without doing anything! |
andreyorst
commented
Apr 7, 2017
|
@cirelli94 you mean that you actually can click and operate it? Open folders, make files etc? |
cirelli94
commented
Apr 7, 2017
|
@andreyorst Yes! If I understood well. http://i.imgur.com/w4ZZxlX.png |
AfroMetal
commented
Apr 16, 2017
|
Is there any hope for a fix? |
DeliciousPickle
commented
Apr 25, 2017
|
I'm also experiencing this issue in KDE Plasma v. 5.9.4 running on Ubuntu 17.04. If I run the Atom editor (an electron app) CPU usage goes to 50% (on quad i7). If I run a second electron app, TagSpaces, CPU pegs at 100% and fan starts blowing. If I disable Global Menu CPU usage goes back to normal/expected. Are any of the people who work on this bit of KDE aware of this? Is anyone working on a fix? |
michaldybczak
commented
Apr 25, 2017
|
I don't know where I saw it, but it looks like the bug is caused by some dbus or library? I am not familiar with those things but it looked like this other package must be fixed in order for menus to work, so that's not directly KDE or electron issue. This may take a while :(. |
ChALkeR
commented
Apr 26, 2017
|
@michaldybczak This is an electron issue — it fires submenu update signals when submenus were not actually updated, see #8455 (comment). For the time being, you can use the workaround mentioned in the initial post. |
kevinsawicki
added
fixme/bug
and removed
triaged/bug
labels
Apr 27, 2017
michaldybczak
commented
Apr 28, 2017
|
If this was an electron issue, it would stay with electron but there are other apps that have the same bug (menu not clicable+increased CPU usage), like for example messenger fb app and some other that I can't remember now. Although there is a possibility that those are different bugs resulting in the same behavior. |
kanocz
commented
Apr 28, 2017
|
@michaldybczak if you're talking about "Messenger for Desktop" than it's also electron app (just unpacked deb and see chromium components + libnode.so and so on) |
michaldybczak
commented
Apr 28, 2017
|
Ach, didn't know that. Thanks. Then let's hope electron wakes up and fixes this thing. I can live without working menu, but CPU elevated usage is a show stopper. |
gugadev
commented
May 11, 2017
•
|
I can reproduce it too under KDE Neon. I suggest changing the |
cirelli94
commented
May 11, 2017
|
I confirm, I'm on Arch and I've used KDE and had the bug. I've just switched to Gnome and there isn't this problem. |
michaldybczak
commented
May 12, 2017
|
Sure it's about KDE @gugadev and @cirelli94 , because it's exactly the point of this bug: it appears with KDE global menus, so no wonder it's not present in Gnome... |
This was referenced May 12, 2017
rilian-la-te
commented
May 28, 2017
|
vala-panel-appmenu (any of applets) have this problem? |
otsoaUnLoco
commented
May 30, 2017
|
@rilian-la-te |
gasinvein
commented
Jun 12, 2017
|
So what actually causes the problem? Is it electron or KDE issue? |
michaldybczak
commented
Jun 12, 2017
|
It's the electron bug but specific to Plasma environment and to be exact, to global menus. If you don't use them, there is no problem, but when you do use them, electron apps usually cause high CPU usage and result with none functional menus. |
theidiotyouyellat
commented
Jun 13, 2017
|
@michaldybczak seems like it's not specific to Plasma any more. The wire/wire-desktop#661 was also noted on i3. |
This was referenced Jun 26, 2017
stephensrmmartin
commented
Jul 12, 2017
|
This is an electron bug. Please fix it. It's not only causing increased CPU, but it is leading plasmashell to consume up to 60% of my memory. When I tell electron to not use global menus, plasmashell stays at about 5%. It's making slack use entirely too much memory and cpu as well, unless global menu is disabled. No other installed applications cause this problem on my machine. |
This was referenced Jul 12, 2017
RomanMarchenko
commented
Jul 14, 2017
•
|
Need to fix it, big problem! |
michaldybczak
commented
Jul 14, 2017
|
Nobody at electron seems to care. It's a half year now since it was discovered and nothing has changed. |
djahma
commented
Jul 14, 2017
|
@kevinsawicki said on 22/02 he'd look for a fix but he seems to have been carried away. That's a shame given all the great electron apps out there, starting with Atom, and the kool features of KDE today. Stayed with cinnamon because of this bug |
tristanlins
commented
Jul 14, 2017
|
Simply create a export ELECTRON_FORCE_WINDOW_MENU_BAR=1as madrzazg suggested and relogin. Yes the global menu is missing, but it works :-) |
michaldybczak
commented
Jul 15, 2017
|
Thanks @tristanlins, will check that workaround. |
joaomoreno
referenced this issue
in Microsoft/vscode
Jul 18, 2017
Open
Electron causes high CPU on KDE #30485
MohamedSlama
commented
Jul 18, 2017
•
|
Awesome @tristanlins & @madrzazg and if anyone need the menu press ALT key |
zcbenz
assigned
zcbenz
and unassigned
kevinsawicki
Jul 19, 2017
michaldybczak
commented
Jul 19, 2017
|
The workaround that @tristanlins and @madrzazg gave works perfectly :). No global menus, but CPU is not burdened and menu in a program works. |
ChALkeR
commented
Jul 19, 2017
•
|
Just a reminder: the workaround has been listed here from the start in the very first post of this thread As a persistent solution, I recommend placing |
zcbenz
referenced this issue
Jul 20, 2017
Merged
Only update dbus menu when it has been changed #10070
michaldybczak
commented
Jul 20, 2017
|
@ChALkeR, maybe so, but it was completely incomprehensible to me. @tristanlins was the first to post it in an understandable manner. Not all linux users are tech geeks. |
zcbenz
closed this
in
#10070
Jul 31, 2017
andreyorst
commented
Jul 31, 2017
•
|
yeah, great. But at some update all my electron apps started to use it's own menu instead of global (I didn't modified any system variables myself), and |
ChALkeR
commented
Aug 1, 2017
•
|
@andreyorst Most likely you still have
To fix that persistently:
To fix that only for the current termilal session: unset ELECTRON_FORCE_WINDOW_MENU_BAR |
andreyorst
commented
Aug 1, 2017
|
@ChALkeR Nope, i didn't set env myself and |
SeptemberHX
commented
Aug 4, 2017
|
Global menu works now with electron 1.6.12 beta release ! |
michaldybczak
commented
Aug 6, 2017
|
Maybe it's a dumb question but I'm not overly technical and I don't work in IT. We were talking here about the framework - sort of base behind apps. To see the result in any given electron app, this app needs to be re-created/recompiled/changed with the new version of the framework and then we need to install that version to have the fix? Right? So the fix will vary from app to app and we may wait quite some time for it? Or am I completely wrong? |
gasinvein
commented
Aug 6, 2017
|
You are right. If this fix will be backported to current version, we may ask app developers to update electron in their apps. |
michaldybczak
commented
Aug 6, 2017
|
On the other hand, on Linux, we do have electron package itself, which is needed for electron apps so maybe we need to wait for its update and all apps would work correctly ;)? |
tristanlins
commented
Aug 7, 2017
|
@michaldybczak not really, the system wide binaries are not necessary. The "package" is mostly the same as |
michaldybczak
commented
Aug 7, 2017
•
|
Then why electron package was installed as a dependency if apps won't be using it anyway? Or maybe some apps do use it (hence electron dependency) and those will be fixed with electron update release but not others? Or maybe there is a way to switch/force apps to use it? |
tristanlins
commented
Aug 7, 2017
|
How do you install the app? Via npm? System package manager? As downloaded archive? If you use your system package manager, it depends on the package itself. As example the google play music desktop player dep package is prepacked with electron and does not have a dependency on it.
If installed via npm, it should be correct that the package will use the npm installed electron binaries. |
michaldybczak
commented
Aug 7, 2017
|
With system package manager pacman from repo or from AUR with yaourt. I don't know any npm's. |
tristanlins
commented
Aug 7, 2017
|
In this case, it depends on the package. I'm not so familiar with pacman/AUR. |
michaldybczak
commented
Aug 7, 2017
|
Both system repo which uses pacman and AUR depend on PKGBUILD files that are sort of recipes. If it has electron as a dependency, then most likely it is needed and will be used. Dependencies are added rather not in vain. |
This was referenced Aug 18, 2017
usta
commented
Aug 24, 2017
•
|
I think this must be fix for it : #10070 , sure it will be exist until atom or any other apps will use 1.7.6beta version of electron |
This was referenced Sep 16, 2017
michaldybczak
commented
Oct 20, 2017
|
I confirm, issue is fixed. I waited and waited on Manjaro and couldn't wait any longer so I checked unstable repo and there it was, electron 1.6.15. I updated it and the problem is fixed with all electron apps :). Global menus work on Plasma, CPU usage is normal (aside Atom, but that's entirely different story). |
ChALkeR commentedJan 20, 2017
•
Edited 1 time
-
ChALkeR
Jan 20, 2017
Linux yoga 4.7.6-1-ARCH #1 SMP PREEMPT Fri Sep 30 19:28:42 CEST 2016 x86_64 GNU/Linux.I'm running Electron under KDE Plasma 5.9, but judging from atom/atom#6255 and atom/atom#5970, it could be also reproduced with other versions. This also affects Atom for obvious reasons ;-).
Expected behavior
Actual behavior
Workaround
Use
ELECTRON_FORCE_WINDOW_MENU_BAR=1(disables globalmenu integration).How to reproduce
electronunder Plasma 5.9 with an enabled global menu (I'm using the menu button in the window titlebar option).htop.Quit— they do nothing.Screenshots
Without

ELECTRON_FORCE_WINDOW_MENU_BAR:With

ELECTRON_FORCE_WINDOW_MENU_BAR:What the menu looks like:

None of the actions work, not even the
File → Quitone.