Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix qt based tray icons not appearing on startup #260

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

inv3rse
Copy link
Contributor

@inv3rse inv3rse commented Nov 23, 2020

The changes from #231 are delaying the registration of the StatusNotifierWatcher by ~2 seconds.
A lot of applications unfortunately do not wait for the dbus name to appear correctly.

The qt implementation with the QSystemTrayIcon, which is for example used in the Nextcloud app does not work correctly.
If during application startup it does not detect a StatusNotifierWatcher it does not wait for it show up.

The example project at https://doc.qt.io/qt-5/qtwidgets-desktop-systray-example.html has the same issue with the icon not appearing if launched on system start. (I removed the early isSystemTrayAvailable check, as nextcloud does not check for this either.)

It can also be reproduced by disabling this extension first and then launching the application.
Enabling the extension later will not trigger the indicator to show up.
It however works correctly if the extension is enabled during application start and then switched off and on again.

This pull request registers the watcher as soon as possible and only delays the visual indicator creation until the desktop startup completed.

Fixes #250

Moves the startup completion delay into the watcher, and
only defers the tray icon creation.
@inv3rse inv3rse force-pushed the bugfix/late-watcher-registration branch from e2a57f9 to f6db696 Compare November 26, 2020 12:22
@flacks
Copy link

flacks commented Nov 30, 2020

Initial tests have all my Qt icons appearing on login. Thank you very much so far; this has been an issue for me!

@ghost
Copy link

ghost commented Dec 1, 2020

Tested, works for me.

@tbpoetke
Copy link

please merge ;)

util.js Show resolved Hide resolved
util.js Outdated Show resolved Hide resolved
@xen0m0rph2020
Copy link

Any updates?

@3v1n0
Copy link
Collaborator

3v1n0 commented Jan 12, 2021

Change looks good, will prepare a release soon

@P4Cu
Copy link

P4Cu commented Jan 15, 2021

I got the same idea of the problem and indeed this pull fixes it. Just tested.

@rogercreagh
Copy link

So we are still waiting for it to be merged and then the next release - any idea of timescale when that is due?

@rmader
Copy link
Contributor

rmader commented Feb 14, 2021

Gentle ping about this on @3v1n0 :)

@felipe19930
Copy link

felipe19930 commented Feb 25, 2021

Guys calm down, this PR has been open for only 3 months now

@universam1
Copy link

any chance this fix be available? Other workarounds possible?

@sercxanto
Copy link

Same issue here with nextcloud client on ubuntu 20.04, but I think it affects other apps as well.

Also waiting desperately for a release of this bugfix ...

@universam1 not really a workaround, but downgrading gnome-shell-extension-appindicator to version 33-1 brings back the systray icon on my machine:

sudo apt install gnome-shell-extension-appindicator=33-1

You can prevent updates to the appindicator permanently, but I would not recommend it as you would also miss the update with the fix:

sudo apt-mark hold gnome-shell-extension-appindicator

@universam1
Copy link

but downgrading gnome-shell-extension-appindicator to version 33-1 brings back the systray icon on my machine:

That did the trick - thanks @sercxanto a lot for outlining this temporary workaround!

Still wondering why this fix is not rolling out? @3v1n0

@Dedas
Copy link

Dedas commented Mar 6, 2021

I have this exact issue with KeepassXC. The rollback fixed it. Would be nice with a real fix though.

@rmader
Copy link
Contributor

rmader commented Mar 7, 2021

FTR: I've been using this patch for three weeks now without encountering regressions.

@3v1n0 3v1n0 merged commit 32065b0 into ubuntu:master Mar 10, 2021
@3v1n0
Copy link
Collaborator

3v1n0 commented Mar 10, 2021

Sorry, I took a while... I'll prepare the release once I'm done with some cleanups I've in mind

@3v1n0
Copy link
Collaborator

3v1n0 commented Mar 12, 2021

@inv3rse I've added some Promise's love in the code, so this change is now quite different and easy as per 46b757d, let me know if there's something I missed there :)

@JOduMonT
Copy link

Not sure but I have this issue with KDE Plasma: 5.18.8 on Ubuntu 20.04 LTS where Qt version is 5.12.8 I tried with the nextcloud-desktop version 2.6.2-1 and 3.4.4-20220318 from the PPA without a better result

@JOduMonT
Copy link

now I'm using Clear Linux with KDE 5.27.5 and Wayland
and flatpak to install flathub com.nextcloud.desktopclient.nextcloud and still have the same issue
the nextcloud client start, it show in task manager but when I minize it it simply disapear but still working in background

@anshah1216
Copy link

but downgrading gnome-shell-extension-appindicator to version 33-1 brings back the systray icon on my machine:

Thanks for your help @sercxanto.
I was having the QSystemTrayIcon disappear after reboot on both Ubuntu 20.04 and 22.04. The issue was fixed on Ubuntu 20.04 but on Ubuntu 22.04 I'm seeing that downgrade is not possible because gnome-shell-extension-appindicator 33-1 is not available.

$ sudo apt install gnome-shell-extension-appindicator=33-1
Package gnome-shell-extension-appindicator is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Version '33-1' for 'gnome-shell-extension-appindicator' was not found

Any ideas how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App icons tray disappear after update