wingpanel steals focus & rises up to 100% of cpu

Bug #1605937 reported by David Heidelberg on 2016-07-23
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Wingpanel
New
Undecided
Unassigned

Bug Description

Everything has been working perfect with Freya. After reinstall to Loki beta2:

I noticed that after while (1-2 minutes) wingpanel start steals every X seconds focus. For example I write "letter" and wingpanel makes it "etet" because of stolen focus.

This behaviour also takes approx. 10-90% of one CPU (observed with htop).

$ killall wingpanel - helps for 1-2 minutes, until it happends again.

Not sure exactly how to reproduce it, but for example when time switches 00:05 -> 00:06, then it steal focus.. Nothing is written in log when that happends.

wingpanel log:
$ killall wingpanel && wingpanel
[INFO 00:01:13.251270] Application.vala:155: System Panel version: 2.0
[INFO 00:01:13.251334] Application.vala:157: Kernel version: 4.6.4-040604-generic
[FATAL 00:01:13.374333] Manager.vala:55: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
[FATAL 00:01:13.376186] wingpanel_widgets_overlay_icon_set_main_icon_name: assertion 'self != NULL' failed
[FATAL 00:01:13.376877] wingpanel_widgets_overlay_icon_set_main_icon_name: assertion 'self != NULL' failed
[FATAL 00:01:13.508991] [GLib-GIO] g_file_get_child: assertion 'G_IS_FILE (file)' failed
[FATAL 00:01:13.509040] [GLib-GIO] g_file_query_exists: assertion 'G_IS_FILE(file)' failed
[FATAL 00:01:13.509061] [GLib-GIO] g_file_get_child: assertion 'G_IS_FILE (file)' failed
[FATAL 00:01:13.509092] [GLib-GIO] g_file_query_exists: assertion 'G_IS_FILE(file)' failed
[FATAL 00:01:13.509124] gee_abstract_collection_get_size: assertion 'self != NULL' failed
[WARNING 00:01:13.509153] Theme.vala:508: Currently selected gtk+ theme 'elementary' does not provide a dock theme, fallback to the built-in defaults!
[FATAL 00:01:13.621630] [GLib] g_hash_table_get_keys: assertion 'hash_table != NULL' failed
[22:01:14.016052 Warning] [DesktopFileInfo] Key file does not have key 'Type' in group 'Desktop Entry'
[22:01:14.044275 Warning] [DesktopFileInfo] Unable to get exec for Other

** (process:12604): CRITICAL **: string_contains: assertion 'self != NULL' failed

** (process:12604): CRITICAL **: string_contains: assertion 'self != NULL' failed
[22:01:31.420061 GLib-GObject-Critical] g_object_set_data: assertion 'G_IS_OBJECT (object)' failed

Also I run two monitor setup (2x 1920x1080, VGA1 & DP1). Wingpanel is placed on second one (DP1, set as primary), which is unrelated to issue.

Ryan Felder (ryancfelder) wrote :

Similar behaviour here. My laptop fan is going mad.

Laptop on a docking station, secondary monitor set to primary, wingpanel lives on it when docked.

Nvidia 340 graphics driver.

Every time I walk away from my pc and come back, wingpanel is unresponsive and consuming 100% of cpu. Killing wingpanel causes it to relaunch and cpu usage goes down, but only temporarily.

Seems to lock up when the displays go to sleep, but I can't state that it never happens if kept awake for a fact.

I am not experiencing wingpanel stealing focus though. Before I determined the issue was wingpanel I would work normally, although my pc was slow, and only notice it when I tried to adjust the volume and found wingpanel unresponsive.

David Heidelberg (okias) wrote :

my HW: Lenovo X201, cpu+gpu: CPU0: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz (family: 0x6, model: 0x25, stepping: 0x5) .

So it seems not related to drivers.

Marcus Wichelmann (l-admin-3) wrote :

> Not sure exactly how to reproduce it, but for example when time switches 00:05 -> 00:06, then it steal focus.

Could you please try, if it still happens while the DateTime-Indicator is uninstalled from your system?

Uninstall:
sudo apt-get remove wingpanel-indicator-datetime
sudo rm /usr/lib/x86_64-linux-gnu/wingpanel/libdatetime.so (Just to make sure, if the file doesn't exist it's okay.)
Logout and login again.

Reinstall after trying:
sudo apt-get install wingpanel-indicator-datetime
Logout and login again.

David Heidelberg (okias) wrote :

Didn't helped, maybe (subjective) it's now not too horrible, but it still happends...

Seems like bug somewhere in wingpanel or GTK..

Marcus Wichelmann (l-admin-3) wrote :

ok, thank you for trying it. it was just an idea. I'll probably need to find a way to reproduce this on my own to be able to look deeper into it.

David Heidelberg (okias) wrote :

maybe I could give you some remote access to my machine? ssh/rdp or something?

I tried setup gdb and wingpanel-dbg, but no success..

Marcus Wichelmann (l-admin-3) wrote :

ok, thank you for trying it. it was just an idea. I'll probably need to find a way to reproduce this on my own to be able to look deeper into it.

Marcus Wichelmann (l-admin-3) wrote :

Argh, I'm sorry, accidently posted my answer again (Don't ask me why.. :D ).

Marcus Wichelmann (l-admin-3) wrote :

AArgh! Okay, I promise I'll stop spamming now :P

To answer your last post:
Yes, I think remote access might help, but I don't have time to investigate further actually, sorry. Maybe somebody else or me will have time later.

I don't think it's related to multi monitor setup.

I see wingpanel consume 100% cpu at times as well and i'm just working with my laptop-screen. Didn't have that problem on freya.

Do you guys have Dropbox installed? Maybe it's somehow related to non-standard indicators?! My battery-indicator is setup to show percentage maybe there's an issue?

David Heidelberg (okias) wrote :

I have owncloud-client with tray icon installed. Sadly, I tried disable it and remove it from system tray, with no change.

With single monitor (only VGA, no DP) attached it seems steal focus for much shorter period of time.

Today, I'll try test longer period with single-monitor setup. Anyway, by changing mouse icon from I (text editing) to normal arrow cursor, it seems this peak & focus stealing is much quicker than on dualsetup. Also only really quick pitch of cpu consumption rise wingpanel in htop.

description: updated

According to strace it's just polling for sth which is unavailable all the time. Following output is repeated nonstop.

[pid 3664] read(4, "\4\0\0\0\0\0\0\0", 16) = 8
[pid 3664] write(4, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 3664] read(0, "", 1024) = 0
[pid 3664] write(4, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 3664] write(4, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 3664] read(0, "", 1024) = 0
[pid 3664] write(4, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 3664] recvmsg(3, 0x7ffc56706d20, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 3664] poll([{fd=0, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=9, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}, {fd=27, events=POLLIN}, {fd=28, events=POLLIN}, {fd=29, events=POLLIN}, {fd=30, events=POLLIN}], 10, 0) = 2 ([{fd=0, revents=POLLIN}, {fd=4, revents=POLLIN}])

I did this strace on my desktop so i guess it's not related to graphicsdrivers (intel vs nvidia) or the batteryindicator and certainly not only a problem on notebooks.

One more thing i recognized ... wingpanel becomes unresponsive and it does not even update the clock anymore.

This issue is NOT related to wingpanel-indicator-ayatana. Uninstalled it and still got this problem.

Ryan Felder (ryancfelder) wrote :

I didn't get notifications of new comments!

I have dropbox installed, yes, but no indicator shows up. Kindof used to that in elementary.

My battery indicator is not set to percentage.

I will try uninstalling the wingpanel-indicator-datetime package as well. I also notice my wingpanel clock freezes, but so does everything else wingpanel related. Clicking Applications or any indicator results in no response, so I didn't find the clock being frozen to be amiss.

Ryan Felder (ryancfelder) wrote :

Uninstalled wingpanel-indicator-datetime... ooh, very minimalist.

If only wingpanel autohid. I rarely interact with indicators and the applications text is entirely superfluous, I use super+space.

Ryan Felder (ryancfelder) wrote :

Removing wingpanel-indicator-datetime did not make any difference for me either. This morning wingpanel is back at 100%.

David Heidelberg (okias) wrote :

Don't take this personally, but wingpanel is most fucked shit I ever seen.. I have no more patience to work with it. How can purge this **** from my computer? My nerves are completly **** up from trying to type on keyboard & fighting with wingpanel permanently using terminal for single command "killall wingpanel"... :/

Let's get the heat up for this bug. Pls mark youself as affected if you are. I guess that's a really bad bug cuz new users probably won't know what to do and switch right to another distro if it hits them.

Ryan Felder (ryancfelder) wrote :

To prevent wingpanel from running...

Open (possibly install) dconf-editor.

Org->pantheon->desktop->cerebre

Change 'monitored processes' from ['wingpanel','plank'] to ['plank']

Ryan Felder (ryancfelder) wrote :

Unfortunately, accessing the applications menu using Super+Space causes wingpanel to spawn.

This is not the way it was in Freya :(

I removed wingpanel from cerberus's monitored processes, installed the wingpanel-*dbg packages and am running wingpanel from my terminal via gdb right now. Tryin to find out what's goin on.

Approx. 3 hours no problems so far. Either it has been fixed by some updates meanwhile or it doesn't happen that way (or at least not a as often). You guys still got issues?

Zisu Andrei (matzipan) wrote :

You can achieve the same result without the need to remove from cerberus. You can just killall && wingpanel with the same effect.

I have run it for a while like this, with the same findings as you.

Zisu Andrei (matzipan) wrote :

Bug #1607877 reports seeing the wingpanel also freeze while it's using 100% of the CPU. But I marked as duplicate of #1604612 since this bug is not related to freezing.

Mariano Jan (mjan) wrote :

Hello! This bug is also affecting me. I've done a clean install. Upon installing owncloud-client, the focus stealing problem arose.
If I close the owncloud client app, the problem is gone. I have a big library of files which are synchronized with this app, and this bug is REALLY annoying as it affects while I write or click, stealing the focus.
Do you need any extra information or debug procedure? Please inform me if there is anything to test.

Thanks!

Zeh Emm (clme-g) wrote :

A few minutes ago I received an update to wingpanel-indicator-ayatana and wingpanel-indicator-sound. After that I killed wingpanel and restarted it to watch its output:
claas@claas-ThinkPad-T400:~$ sudo killall wingpanel && wingpanel
[INFO 17:54:50.934905] Application.vala:155: Systemleiste version: 2.0.1
[INFO 17:54:50.935099] Application.vala:157: Kernel version: 4.4.0-38-generic
Failed to register: Zeitüberschreitung wurde erreicht
claas@claas-ThinkPad-T400:~$

It means that a timelimit has been reached. Then I repeated thesame command and got:

claas@claas-ThinkPad-T400:~$ sudo killall wingpanel && wingpanel
[INFO 17:55:22.373848] Application.vala:155: Systemleiste version: 2.0.1
[INFO 17:55:22.374042] Application.vala:157: Kernel version: 4.4.0-38-generic
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
claas@claas-ThinkPad-T400:~$

Perhaps it's helping.

Zeh Emm (clme-g) wrote :
Download full text (25.8 KiB)

Hi there, it's me again.

I was able to reproduce #24. Even if i haven't read his post till now I got this:

claas@claas-ThinkPad-T400:~$ sudo killall wingpanel && wingpanel -d
[...]
[DEBUG 18:55:44.597482] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.618262] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.618445] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.642260] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.642445] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.671858] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.671905] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.691330] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.691377] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.716218] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.716266] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.735649] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.735849] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.760564] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.760922] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.788585] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.788631] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.813994] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.814500] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.842384] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.842554] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.871191] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.871424] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.898282] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.898326] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.927431] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.927493] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.954294] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.954337] [LIBDBUSMENU-GLIB] Error getting properties on a new menuitem: Error getting properties for ID
[DEBUG 18:55:44.982935] [LIBDBUSMENU-GLIB] Generating properties error for: 0
[DEBUG 18:55:44.982985] [LIBDBUSMENU-GLIB] Error getting prop...

blubberlutsch (blubberlutsch) wrote :

@mjan

The owncloud issue is addressed here: https://bugs.launchpad.net/wingpanel-indicator-ayatana/+bug/1624942

Solution is to upgrade owncloud to nightly (2.3.0) as seen here https://github.com/owncloud/client/issues/5171

Not sure, if that bug is related to this one.

quequotion (quequotion) wrote :

I was about to file my own bug, but I'll jump in on this one unless I find evidence to the contrary. I haven't observed spikes in CPU usage (not that I was looking) but wingpanel does steal focus.

At first I thought this was because I use wingpanel in Openbox and Compiz, rather than Gala, but it appears the problem is in wingpanel itself. I note that the panel also tends to keep focus after indicator popovers collapse. The panel itself should probably not gain focus to begin with, ever--only the indicator popovers are interactive elements.

Compiz has a "focus prevention level" setting in ccsm which can help somewhat, but not cure this problem (and it's a sledgehammer-on-a-thumbtack strategy that causes other problems).

quequotion (quequotion) wrote :

hrm... wingpanel has a dbus plugin that should interact with Gala to handle focus, but i'm not sure that it works. either way, it's not good that wingpanel steals/keeps focus inappropriately in the first place.

This SO answer shows a way (in python) to get the previously focused window at focus-in-event:
http://stackoverflow.com/a/36137157

Maybe there's a way to use this to get wingpanel to revert focus when indicator popovers close, without relying on dbus and gala.

quequotion (quequotion) wrote :

Regarding focus stealing, I might have found a way to prove if it is wingpanel or not that is responsible.

I put this superuser answer: http://superuser.com/a/533254 in a script that outputs to a file, and made a shortcut with gnome-control-center (creates a keyboard shortcut with dconf in /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/; gsettings or switchboard (with -plug-keyboard) should get the same result; gnome-settings-daemon enables the shortcut).

Long story short, when clicks fail to interact with a window I can push the hotkey to find out what the currently active window actually is. After using indicators, it tends to be difficult to switch focus to a window; I have found that wingpanel indeed remained active at that time.

I'm still waiting for an opportunity to check what steals focus spontaneously (sometimes focus goes away from a window while it is in use).

quequotion (quequotion) wrote :

It's been a while since I used wingpanel in openbox without composting, but I sometimes do that sort of thing.

Whenever the mouse is over wingpanel, it creates a black field that covers everything else on the screen. Sometimes this goes away as soon as the mouse moves away from wingpanel, sometimes it does not. This field does block input to windows underneath it, even if the user has not clicked on wingpanel (ie, focus has not actually changed).

quequotion (quequotion) wrote :

This patch disables expansion on mouseover. Is there a reason to be doing this? If there is something that expanding is useful for, I think it is sufficient to do it when an indicator is clicked. That still happens with this patch (when used in a window manager without composting, a black field will be drawn across the screen under the panel and the clicked indicator's menu).

I think this could resolve the "focus stealing" problem some users are experiencing with wingpanel.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.