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

[Linux] [Ubuntu 16.04] No tray icon in Xenial #4693

Closed
stephen-d-hill opened this issue Apr 17, 2016 · 63 comments

Comments

@stephen-d-hill
Copy link

commented Apr 17, 2016

Expected behaviour

To see icon

Actual behaviour

No icon

Steps to reproduce

Install owncloud client

Client configuration

Client version: 2.1.1+dfsg-1ubuntu1

Operating system: Xubuntu 16.04

OS language: English UK

@guruz guruz changed the title No notification icon in Xubuntu Xenial No tray icon in Xubuntu Xenial Apr 18, 2016

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2016

What do you see instead?
Can you run the client as owncloud --logfile - and paste the output?
Which Qt version?

@guruz guruz added the Needs info label Apr 18, 2016

@stephen-d-hill

This comment has been minimized.

Copy link
Author

commented Apr 18, 2016

The owncloud main window works fine, just no notification icon.
I am unsure how to find out my QT version.

logfile -
owncloud_logfile.txt

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2016

Thanks, the logfile mentioned it.. Using Qt 5.5.1

Is there nothing before that in the log?

@ckamm @danimo maybe you know more about those tray issues..

@stephen-d-hill

This comment has been minimized.

Copy link
Author

commented Apr 18, 2016

Used --logfile instead of --logwindow this time -
owncloud_logfile1.txt

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2016

Maybe this in Qt 5.6 helps..

commit f156c33c2739d84b97cdedf6ae9568b9cea728d5
Author: Dmitry Shachnev <mitya57@gmail.com>
Date:   Fri Apr 1 21:28:00 2016 +0200

    dbustray: Implement better detection of indicator-application

    We need to do the icon cache trick all desktops using indicator-application,
    these are not limited to Unity. For example, the default Xubuntu and Lubuntu
    desktops use indicator-application too.

    Without this, tray icons will be improperly shown on these desktops.

    Change-Id: Id397bbe9b594152d7c3a29c36c853e928af7dde4
    Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2016

Some more changes from that Qt branch.. FYI @ckamm

commit a4fac65938fdee74c07d34727920fb74087f82c6
Author: Dmitry Shachnev <mitya57@gmail.com>
Date:   Sat Feb 6 14:42:39 2016 +0300

    dbustray: Support late registering of tray icon menu

    If a menu is added to the tray icon after the icon itself has been registered,
    we need to register the menu properly.

    Change-Id: I19a6d78848142d66c2cd882746d8d55c0b9a2818
    Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
    Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>

commit 7ad930987da7bb1d9aed17f25a1d99eeb5574a42
Author: Dmitry Shachnev <mitya57@gmail.com>
Date:   Sat Feb 6 19:12:52 2016 +0300

    dbustray: Do not change m_menu in QDBusTrayIcon::createMenu()

    This method can be called for a submenu after it's called for the top-level
    menu, and we should not replace it with a submenu.

    Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741
    Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
    Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
@scroom

This comment has been minimized.

Copy link

commented Apr 22, 2016

Can I provide more info? I'm as well experiencing this bug.

@danimo

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2016

I now upgraded to 16.04 and the packages and I can confirm above findings. The workaround for now is to use the Ubuntu 15.10 packages provided by us. Those still are Qt4 based but solve the problem.

@danimo

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2016

@danimo

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2016

This must be a special bug related to the way we rebuild the System tray. A trivial example works just fine.

#include <QApplication>
#include <QSystemTrayIcon>
#include <QImage>
#include <QPixmap>
#include <QMenu>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QImage img(64,64, QImage::Format_ARGB32);
    img.fill(Qt::red);
    QSystemTrayIcon sti(QIcon(QPixmap::fromImage(img)));
    QMenu *menu = new QMenu();
    menu->addAction("Foo");
    menu->addAction("Bar");
    menu->addSeparator();
    QMenu *submenu = new QMenu("Sub Menu");
    submenu->addAction("Bleh");
    menu->addMenu(submenu);
    menu->addSeparator();
    QObject::connect(menu->addAction("Quit"), SIGNAL(triggered(bool)), &a, SLOT(quit()));
    sti.setContextMenu(menu);
    sti.show();

    return a.exec();
}
@Mustangman1966

This comment has been minimized.

Copy link

commented Apr 24, 2016

Expected behaviour

To see icon

Actual behaviour

No icon

Steps to reproduce

Install owncloud client

Client configuration

Client version: 2.1.1+dfsg-1ubuntu1

Operating system: ubuntu 16.04

OS language: Dutch

@danimo

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2016

We know, please do not post any +1's. We are working on a solution to the problem.

@ogoffart

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2016

I was able to locate the problem. The problem is in ubuntu's "appmenu-qt5" and is a bug that cause our call to QSystemTrayIcon::isSystemTrayAvailable() to remove the icon.

That's because appmenu-qt5 seems to assume there is only one QPlatformSystemTrayIcon while there can be one per QSystemTrayIcon. in particular, QSystemTrayIcon::isSystemTrayAvailable creates a temporary one, and when it gets distroyed, it unregister the dbus object for the existing systray.

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2016

FYI @mitya57

@mitya57

This comment has been minimized.

Copy link

commented Apr 25, 2016

Thanks @guruz for pointing me to this, and thanks to @ogoffart for narrowing down the problem.

Appmenu-qt5 is dead, and we want to remove it from Ubuntu as soon as our Qt is updated to 5.6 (which has native support for D-Bus trays and global menus). However, provided that 16.04 is an LTS release, it may make sense to get the appmenu-qt5 bug fixed there. I will add it to my list, however I have very few time, so I don't know when I will be able to get to it. Merge proposals against lp:appmenu-qt5 welcome, of course :)

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2016

@mitya57 thanks for the reply :) Then we need to workaround it from our side. XDG_CURRENT_DESKTOP should be Unity on 16.04?

@guruz guruz added bug and removed Needs info labels Apr 25, 2016

@guruz guruz added this to the 2.2.0-current milestone Apr 25, 2016

@guruz guruz added the sev2-high label Apr 25, 2016

@nazar-pc

This comment has been minimized.

Copy link

commented Apr 25, 2016

Yes

~>  echo $XDG_CURRENT_DESKTOP 
Unity
@mitya57

This comment has been minimized.

Copy link

commented Apr 25, 2016

$XDG_CURRENT_DESKTOP depends on environment, but it's not related to this bug.

For workaround on your side, try checking for $QT_QPA_PLATFORMTHEME and unsetting it if it's equal to appmenu-qt5 (before constructing the QGuiApplication).

@ogoffart

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2016

I reported the bug to appmenu-qt5: https://bugs.launchpad.net/appmenu-qt5/+bug/1574699

@guruz guruz changed the title No tray icon in Xubuntu Xenial [Linux] [Ubuntu 16.04] No tray icon in Xubuntu Xenial Apr 25, 2016

@etamme

This comment has been minimized.

Copy link

commented May 12, 2016

So yea I saw that when I was searching, but this morning my systray icon was fine, but after I installed the updates in the linked gist, the owncloud systray icon got messed up.

@Niyes

This comment has been minimized.

Copy link

commented May 13, 2016

In Debian 8 (Jessie) missing tray icon after update to the 2.2.0 version :(

@cmburg

This comment has been minimized.

Copy link

commented May 14, 2016

Same in elementary OS 0.3 (64bit) (32 bit not tested yet but had not problems at all IIRC)

@DroWnThePoor

This comment has been minimized.

Copy link

commented May 14, 2016

I'm having this problem as well.No tray icon at all since last 2 updates.
I have another machine running the client before the updates and it works perfectly.
I was wondering what exactly I'd need to do to transfer that version of the client from one
Ubuntu install to another?
Can anyone advise me?

@tony5

This comment has been minimized.

Copy link

commented May 14, 2016

@DroWnThePoor

It has already been acknowledged that there is a bug and a work around has been posted.

Ubuntu 16.04 / client Version 2.2.0%nil (build 1605) Using Qt 5.5.1 = no tray icon with gnome desktop.

The client still works without the tray icon but if you need it then the commands posted above will work.

You can adjust the program startup or manually run the bellow command in a terminal.

~$ killall owncloud && nohup env QT_QPA_PLATFORMTHEME=generic owncloud >/dev/null &

@mitya57

This comment has been minimized.

Copy link

commented May 14, 2016

I have created a proper fix for this bug in appmenu-qt5. While I'm waiting for a review I have uploaded the package with this fix to my PPA so that you can test it.

Commands to get the package from my PPA are:

sudo add-apt-repository ppa:mitya57/ppa
sudo apt-get update
sudo apt-get install appmenu-qt5

Please test and give your feedback.

@tony5

This comment has been minimized.

Copy link

commented May 14, 2016

@mitya57
did not work for me, maybe I did it wrong. I did not add the ppa but installed
appmenu-qt5_0.3.0+16.04.20151130-0ubuntu1+ppa1_amd64.deb from your link
removing appmenu-qt5 all together will work
or
adjust start up
~$ killall owncloud && nohup env QT_QPA_PLATFORMTHEME=generic owncloud >/dev/null &

I also have no idea why the issue is marked closed?

@mitya57

This comment has been minimized.

Copy link

commented May 16, 2016

Can somebody else try that PPA? It is quite strange it did not work for you @tony5

@robmi77

This comment has been minimized.

Copy link

commented May 18, 2016

@mitya57
same as Tony5. Did not work for me either. added the ppa, updated and installed appmenu-qt5.
"Setting up appmenu-qt5 (0.3.0+16.04.20151130-0ubuntu1+ppa1)"
running ubuntu 16.04 lts with xfce4-panel and owncloud 2.2.0. No icon tray.
If I remove the the newly installed appmenu.qt5 the owncloud icon appears in the systray.

@nickvergessen

This comment has been minimized.

Copy link
Contributor

commented May 18, 2016

The workaround from #4693 (comment) also helped on Linux Mint 17.3 (based on Ubuntu 14.04) using Qt 5.2.1

@detly

This comment has been minimized.

Copy link

commented Nov 26, 2016

Still have this bug on Ubuntu 16.04.1 LTS. @tony5's PPA didn't change it.

appmenu-qt5: 0.3.0+16.04.20151130-0ubuntu1
owncloud-client: 2.2.4-1.3 (from OwnCloud PPA)

The workaround of changing Exec=owncloud to Exec=env QT_QPA_PLATFORMTHEME=generic owncloud (in /usr/share/applications/owncloud.desktop) does not make the tray icon appear, even after reboot.

@detly

This comment has been minimized.

Copy link

commented Nov 26, 2016

Turns out I had to change the entry in Gnome's startup applications (from /usr/bin/owncloud to /usr/bin/env QT_QPA_PLATFORMTHEME=generic owncloud).

@ghost

This comment has been minimized.

Copy link

commented Dec 18, 2016

I also have this issue on Ubunu 16.10. The icon disappears a few minutes after owncloud launches. Do I really have to apply some hacks to get it to work? The issue indicates that this was fixed, so I don't know whether this is considered already fixed or there was some regression or so...

@mitya57

This comment has been minimized.

Copy link

commented Dec 19, 2016

@christiandreher You have not specified which version of owncloud are you using, and whether or not you have appmenu-qt5 installed.

Anyway, today I have uploaded a new version of owncloud-client package to Ubuntu 16.10, with #5072 backported, which should make it a bit better. It should be ready for testing in proposed pocket in a couple of days weeks. This is tracked in LP: #1635577.

@ghost

This comment has been minimized.

Copy link

commented Dec 20, 2016

@mitya57 sorry for the lack of information. When I wrote this, I was on the lastest release which was available in the 16_10 repository. I also found out that the icon disappears whenever I suspend my laptop. So after a reboot it works, but when I suspend it and wake it up again the icon will look like on this screenshot (the one in the middle with the red crossed circle)

As soon as I am back on the machine I will try the updated version and let you know whether it helped or not. Thanks for the heads up :)

@mitya57

This comment has been minimized.

Copy link

commented Jan 4, 2017

@christiandreher The new version was accepted into Ubuntu 16.10 Proposed repository today, please try it.

@guruz

This comment has been minimized.

Copy link
Collaborator

commented Jan 5, 2017

@mitya57 There seems to me a version mixup, I see 2.2.2 on your link instead of 2.2.4

@mitya57

This comment has been minimized.

Copy link

commented Jan 5, 2017

@guruz All right, Ubuntu 16.10 shipped with 2.2.2, I backported some fixes to that version. Ubuntu 17.04 has 2.2.4.

@yendar28

This comment has been minimized.

Copy link

commented Jan 12, 2017

Hi, since some days I have the same problem with a vanished "notification icon" and found an easy workaround for me. There were some qt5 files in the last update using Xubuntu.

Workaround: Right-Click on "start icon" of Owncloud Client (in Systray) -> Properties -> Edit the currently selected Item -> Then activate "Use startup notification"

After some tries the systray "notification icon" vanished again. So I deactivated "Use startup notification" this time and the icon appeared again after owncloud start. Do not ask me why. ;-)
Starting owncloud from terminal also works.

My System:
Xubuntu 14.04 (xfce)
owncloud client 2.2.4
using Qt 5.2.1

Edit: But I am not sure if just happens by chance. Perhaps it vanishes and occures completly independent from my given hint..

@guruz guruz modified the milestones: 2.3.0, 2.2.0 Jan 20, 2017

@FlorianFranzen

This comment has been minimized.

Copy link

commented Jul 10, 2017

@stephen-d-hill solutions works well, which is uninstalling appmenu-qt5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.