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

Tray icon does not work on linux mint 19.2 Cinnamon #224

Closed
antrrax opened this issue Sep 29, 2019 · 32 comments
Closed

Tray icon does not work on linux mint 19.2 Cinnamon #224

antrrax opened this issue Sep 29, 2019 · 32 comments
Assignees
Labels

Comments

@antrrax
Copy link
Contributor

@antrrax antrrax commented Sep 29, 2019

Tray icon does not work on linux mint 19.2 Cinnamon

Maybe it could be for this reason:
https://blog.linuxmint.com/


But I tested on ubuntu 19.04 and it is working

@DamirPorobic DamirPorobic self-assigned this Sep 29, 2019
@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Sep 29, 2019

For the Tray Icon we use here Qt's QSystemTrayIcon. The Tray Icon should be there if the Window Manager supports it as stated here: https://doc.qt.io/qt-5/qsystemtrayicon.html#details

The link that you have posted points out that Mint is struggling with Tray Icons but writing our own Tray Icon would be overkill I'm afraid, so I must say here won't fix for now.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 2, 2019

I can reproduce the issue here in Mint 19.2 Cinnamon (based on Ubuntu 18.04 LTS). Although the tray applet is loaded, there's no sign of ksnip in it.

Our tray supports All window managers and independent tray implementations for X11 that implement the http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop.org XEmbed system tray specification.

We also have support for indicators (appindicators) and they cover All X11 desktop environments that implement the D-Bus http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem specification, including recent versions of KDE and Unity.. This is disabled by default in Cinnamon but you can enable support for it in the System Setting -> General tab.

Either way, whether indicator support is enabled or not, I can't get ksnip to show up in the tray.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 2, 2019

I'm not really sure how to troubleshoot Qt5.. I'm new to this toolkit.

In dbus, cinnamon is listening properly..

image

Launching ksnip shows three entries on the session bus in d-feet, but no interfaces.

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 2, 2019

Hmm, do we need some dbus support to make the tray icon work on Mint? Currently we have no specific dbus support in ksnip and the Tray Icon seems to be working on Ubuntu and OpenSUSE without dbus support.

@DamirPorobic DamirPorobic added question and removed wontfix labels Oct 2, 2019
@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

I was looking yesterday on the internet for clues but fount nothing so far. I'll tray to install a Mint VM and check the code for any clues, after I'm done with a feature that I'm working on. Maybe you guys could meanwhile check on the Mint forum if someone had such issues with a Qt based application.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

Hi @DamirPorobic,

Do you know other apps I could test which also use QSystemTrayIcon?

The technology we support in Cinnamon is the same as in Xfce, MATE, GNOME. You don't need any special DBUS handling. It's possible there's a regression with QT5 though. I see reports online that QT4 needed sni-qt.

DamirPorobic added a commit that referenced this issue Oct 3, 2019
@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

Hey @clefebvre, unfortunately there is no app that come to my mind that is written in Qt and has a Tray Icon, need to google a bit. I could write some super simple example that uses QSystemTrayIcon but then again, we're not doing anything fancy in ksnip either. I've created a branch with some debug outputs, currently I'm mostly interested in what https://doc.qt.io/qt-5/qsystemtrayicon.html#isSystemTrayAvailable returns, if the Qt part thinks the tray is not supported we would need to ask them or check the source code how it determines if the tray is available or not.
Here the branch https://github.com/DamirPorobic/ksnip/tree/testTrayIconAndGlobalShortcuts
There is also some debug output for global hotkey that also seam to be not working on Mint but that is another issue I guess.

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

OK let me check..

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

I don't get a systray icon with clementine either...

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

Oh wait.. silly me, it's a Cinnamon option.. because it's an MPRIS client, there's an option our sound applet to hide the systray for it. OK So, I unchecked that option and I can see the clementine indicator.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

Alright, and if I disable support for appindicators, libappindicators fallbacks to GTK and I get clementine in my natray (Xembed) systray. It works fine.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

That's clementine 1.3.1, but looking at the package dependencies @DamirPorobic , it looks like it's using QT4, not QT5...

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

@clefebvre sorry, didn't check the dependencies. Let me check for another app...

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

I'll try my luck at a helloworld qt5 tutorial :)

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

OK, this works for me:

#include <QApplication>
#include <QtCore/QDebug>
#include <QLabel>
#include <QWidget>
#include <QtGui/QIcon>
#include <QtWidgets/QSystemTrayIcon>

int main(int argc, char *argv[ ])
{
QApplication app(argc, argv);
QLabel hello("<center>Welcome to my first Qt program</center>");

QPixmap oPixmap(32,32);
//QMenu* menu1 = new QMenu(); // want to get a context menu from system tray
oPixmap.load ("/usr/share/icons/Mint-Y/apps/24/abiword.png");
QIcon oIcon( oPixmap );
QSystemTrayIcon *trayIcon = new QSystemTrayIcon(oIcon);
qDebug() << trayIcon->isSystemTrayAvailable();
//trayIcon->setContextMenu( menu1);
trayIcon->setVisible(true);
trayIcon->showMessage("Test Message", "Text", QSystemTrayIcon::Information, 1000);

hello.setWindowTitle("My First Qt Program");
hello.resize(400, 400);
hello.show();
return app.exec();
}
@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

qDebug() << trayIcon->isSystemTrayAvailable(); returns True, and I see abiword in the systray.

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

ok, that's a surprise. What Qt Version is that? Ksnip uses 5.6.1.
I'm installing Mint on a VM meanwhile.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu

That's what qmake --version shows.. I'm new to all this, so I'm not really sure. I use QtCreator to run the code.

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

Ok, I'll check.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

@DamirPorobic ksnip always shows a tray icon? or it's something you enable in the prefs?

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

You can enable/disable it via settings but default is enabled.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

I don't see an option for it...

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

Here a screenshot, though in German
image

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

image

Version 1.5.0

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

Oh, sorry, this is a new feature only available in 1.6.0. which is still WIP
You can download it from here https://github.com/DamirPorobic/ksnip/releases/tag/continuous

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 3, 2019

Ok, I upgraded to the CI build (1.6) and I get the option and the tray works fine :)

Ah well, I guess I learnt a little bit about Qt, so it was worth it :)

@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 3, 2019

Oh, so it's working? Nice, better then troubleshooting Qt Bugs :)

@antrrax for you it's still not working with 1.6.0? Is there anything that @clefebvre mentioned above that you haven't enabled?

@antrrax

This comment has been minimized.

Copy link
Contributor Author

@antrrax antrrax commented Oct 3, 2019

Yes I am using version 1.6 downloaded via gitclone. I'm currently at my job and I don't have access to Mint. Later when I'm home I review this. But I use Mint 19.2 Cinnamon x64 and the tray icon wasn't showing. But then should some problem of my specific configuration

@antrrax

This comment has been minimized.

Copy link
Contributor Author

@antrrax antrrax commented Oct 3, 2019

It really is some problem with my home computer!
I used an old notebook and formatted and installed Cinnamon and the Ksnip tray icon worked.

Sorry for the inconvenience of reporting this issue

@antrrax antrrax closed this Oct 3, 2019
@DamirPorobic

This comment has been minimized.

Copy link
Owner

@DamirPorobic DamirPorobic commented Oct 4, 2019

No worries, happens :)

@clefebvre thanks for having a look at this.

@clefebvre

This comment has been minimized.

Copy link

@clefebvre clefebvre commented Oct 4, 2019

No problem, thanks for your time @DamirPorobic .

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