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

Empty tray menu in Cinnamon using Qt5 #431

Closed
KenjiTakahashi opened this issue Jan 2, 2016 · 35 comments
Closed

Empty tray menu in Cinnamon using Qt5 #431

KenjiTakahashi opened this issue Jan 2, 2016 · 35 comments

Comments

@KenjiTakahashi
Copy link

This was reported by several users to CopyQ AUR package of which I'm maintainer.
I'm not sure whether it is CopyQ or Cinnamon, so I'm just gonna start here.
Like said in the title, CopyQ built with Qt5, running in Cinnamon. When clicking the tray icon, an empty "menu widget" appears (see screenshot). Also it seems that the tray icon itself is rendered weirdly - it's smaller and a bit to the side(?) (see second screenshot with Qt4 version for comparison).
Compiled with Qt4 works, also tried on MATE and Xfce - works as well. Seems like something's on CopyQ<->Qt5<->Cinnamon.
To add to the plot, the empty widget part "fixes itself" after invoking "copyq menu" from terminal (icon stays weird).

qt5
qt4

All of this was tested by me using Manjaro 15.12 Cinnamon, CopyQ 2.5.0, Cinnamon 2.8.6.

@hluk
Copy link
Owner

hluk commented Jan 2, 2016

Some desktop environments replace Qt tray with their version and try to reconstruct the menu when user clicks the tray icon. The menu invoked with copyq menu is the probably the original version.

There are a lot of bug reports for tray in Cinnamon.

Perhaps using different tray applet can solve some issues.

@KenjiTakahashi
Copy link
Author

I think you might very well be right.
I'm wondering, though, why it fixes itself after calling copyq menu? Perhaps it triggers some routine that is "known" to the applet and it then decides to continue loading as expected?

@hluk
Copy link
Owner

hluk commented Jan 3, 2016

If you run the command you use CopyQ directly but if you click the tray icon it calls some wrapper libraries. I think this still involves libraries sni-qt and libdbusmenu.

There is arch package for libdbusmenu-qt5 which handles creating tray menu for Qt 5 apps so the problem is likely somewhere there.

@KenjiTakahashi
Copy link
Author

I understand that. What I meant is that after invoking the command, the applet based menu starts working as well. After further investigation, though, it is not really "working", it gets "refreshed".
It goes like this. When I first start CopyQ, tray menu is empty. After calling the command, tray menu starts appearing OK. After I add new item to clipboard (e.g. copy some text), tray menu displays as before (new item does not appear). After calling the command again, tray menu gets updated with new item.

BTW: I've tried using the "collapsible" version you've linked above, but strangely enough, CopyQ icon does not appear there at all...
BTW2: I'm not sure I'll have enough urge to get to the bottom of this as I don't use Cinnamon (in fact, I don't use tray at all). I've linked this issue in the AUR page, perhaps one of the users will be willing to do the digging. Just sayin' :-).

@hluk
Copy link
Owner

hluk commented Jan 3, 2016

Oh, I think I know what is the problem. The wrapper library libdbusmenu-qt is not emitting Qt signal that should be emitted before showing the menu -- in CopyQ the items in tray menu are created/updated right before the menu pops up. This seems to be bug in the library and as you mention only with Qt 5.

@raqua
Copy link

raqua commented Mar 15, 2016

I am affected by this bug as well. I understand, that this is not a bug in CopyQ, but is this issue in libdbusmenu-qt reported somewhere so we can get that fixed? I would be happy to report it, but I do not really understand much about it, so maybe if you could report it ... I would really appreciate it. Thanks for considersing that and thanks for otherwise great SW.

@hluk
Copy link
Owner

hluk commented Mar 15, 2016

@raqua You can post the bug report here (I don't have an account for bug posting there and I'm quite skeptical about the wrapper libraries for tray).

@genachka
Copy link

As referenced in #595 for me, I'm not even seeing an empty icon on 16.04 with Cinnamon 3.2.2 using CopyQ 3.8.x. As noted in that issue, a workaround with CopyQ 3.7.1 of exiting CopyQ after login and starting it up again the icon would display. But with CopyQ 3.8.x that no longer works. The only way I can get to CopyQ is the keyboard shortcut which is a bit frustrating.

@hluk
Copy link
Owner

hluk commented Dec 17, 2016

Oh sorry, I closed #595 as duplicate of this but this is just empty tray menu and not missing tray icon.

Is libdbusmenu-qt/libdbusmenu-qt5 and sni-qt still needed to be installed? If it is, I should add those as dependencies for Debian/Ubuntu package.

@genachka
Copy link

Looks like I already have them installed:
libdbusmenu-qt5 is already the newest version (0.9.3+16.04.20160218-0ubuntu1).
sni-qt is already the newest version (0.2.7+15.10.20150729-0ubuntu1).

@hluk
Copy link
Owner

hluk commented Dec 17, 2016

OK, seems that sni-qt shouldn't be needed with newer Qt libraries (info here).

@genachka Try to start copyq from console and see if there are any warnings or errors.

@genachka
Copy link

I exited and confirmed the process wasn't running. Started from console, copied to clipboard, pasted from clipboard, open via keyboard hotkeys. Nothing generated any errors or warnings on console.

@hluk
Copy link
Owner

hluk commented Dec 19, 2016

I tested this in Cinnamon 2.8.6 on Ubuntu 16.04 and on Cinnamon 3.2.0 on Arch Linux.

If I start CopyQ after the panel and tray is started, everything looks fine. When starting CopyQ on login, tray icon is missing.

As workaround I edit file ~/.config/autostart/copyq.desktop and replace

Exec="/usr/bin/copyq"

with

Exec=sh -c "sleep 5; /usr/bin/copyq"

Not sure why you cannot see icon even after restart. Seems like something in Cinnamon is broken or a dependency is missing. Problem could also be that the icon is in SVG format (/usr/share/icons/hicolor/scalable/apps/copyq-normal.svg).

@hluk
Copy link
Owner

hluk commented Dec 19, 2016

As mentioned in #589, the icon could be in incompatible format, so you can try to run following to re-convert the icon.

sudo convert -background none /usr/share/icons/hicolor/scalable/apps/copyq-normal.svg{,}

@genachka
Copy link

genachka commented Dec 19, 2016

I tested this in Cinnamon 2.8.6 on Ubuntu 16.04 and on Cinnamon 3.2.0 on Arch Linux.
Any chance you can also try it with Cinnamon 3.2.6? That's what I'm on and may help figuring this out.

Converting icon via (sudo convert -background none /usr/share/icons/hicolor/scalable/apps/copyq-normal.svg{,}) didn't make a difference. :(

@hluk
Copy link
Owner

hluk commented Dec 21, 2016

Can you test this with copyq-2.8.2-beta package? Packages are here. It should install icons in PNG format too.

@genachka
Copy link

Unfortunately it didn't help. :(

@genachka
Copy link

genachka commented Jan 5, 2017

I thought I may have grabbed the previous version from that link and so I just tried again. Turns out I did grab the right now, but as noted previously it didn't help. Any other suggestions / ideas?

@hluk
Copy link
Owner

hluk commented Jan 6, 2017

@genachka I just tested tray icon with Cinnamon 3.2.7 on Arch Linux and icon is still visible in tray.

Can you check if option "Disable tray" is unchecked under "Tray" config tab?

Also you can try removing following icons (which are replaced with PNG formats in new version):

  • /usr/share/icons/hicolor/scalable/apps/copyq-normal.svg
  • /usr/share/icons/hicolor/scalable/apps/copyq-busy.svg

@genachka
Copy link

genachka commented Jan 6, 2017

"Disable tray" is unchecked. I deleted the two .svg icons. And does appear I do have the .png versions:

/usr/share/icons/hicolor/128x128/apps/copyq-normal.png
/usr/share/icons/hicolor/16x16/apps/copyq-normal.png
/usr/share/icons/hicolor/22x22/apps/copyq-normal.png
/usr/share/icons/hicolor/24x24/apps/copyq-normal.png
/usr/share/icons/hicolor/32x32/apps/copyq-normal.png
/usr/share/icons/hicolor/48x48/apps/copyq-normal.png
/usr/share/icons/hicolor/64x64/apps/copyq-normal.png

and

/usr/share/icons/hicolor/128x128/apps/copyq-busy.png
/usr/share/icons/hicolor/16x16/apps/copyq-busy.png
/usr/share/icons/hicolor/22x22/apps/copyq-busy.png
/usr/share/icons/hicolor/24x24/apps/copyq-busy.png
/usr/share/icons/hicolor/32x32/apps/copyq-busy.png
/usr/share/icons/hicolor/48x48/apps/copyq-busy.png
/usr/share/icons/hicolor/64x64/apps/copyq-busy.png

@hluk
Copy link
Owner

hluk commented Jan 6, 2017

@genachka I probably won't be able to do anything with this -- looks like bug in Cinnamon with Qt 5 apps (strangely I don't see this issue on Arch Linux). Do you have any icons in tray (especially Dropbox, Skype or other apps using Qt 5)?

@genachka
Copy link

genachka commented Jan 6, 2017

I do have Skype (for Linux Alpha) and Shutter and Remmina and Chrome icons on the tray, though I don't know which of these are Qt 5?

@l4r1k4
Copy link

l4r1k4 commented Oct 30, 2017

install libqt4-svg to solve this.

@hluk
Copy link
Owner

hluk commented Oct 30, 2017

Is this still an issue? Last time I checked the app with Cinnamon everything worked fine.

@matteotanca The app uses Qt 5, not Qt 4, so libqt4-svg shouldn't be needed. (Actually, only OpenSUSE package uses Qt 4 but I'll be dropping it altogether in near future.)

@genachka
Copy link

@matteotanca already had that installed, doesn't help me.

@hluk Yes, still an issue for me.

@raqua
Copy link

raqua commented Oct 30, 2017

Works fine for me on Cinnamon and Arch Linux.

@genachka
Copy link

@raqua which Cinnamon version? I'm on 3.4.6 under Ubuntu 16.04 and have no tray icon.

@raqua
Copy link

raqua commented Oct 30, 2017

I am not currently at my home computer, but I guess I am on the latest Cinnamon version for Arch linux, which should be 3.4.6.
Right now, I am on Mint 18 with Cinnamon 3.4.6 and it works fine too.

@hluk
Copy link
Owner

hluk commented Oct 30, 2017

@genachka Do you use any extensions for tray?

@genachka
Copy link

Nope, no extensions.

@l4r1k4
Copy link

l4r1k4 commented Oct 31, 2017

In Ubuntu 16.04 LTX if you uninstall libqt4-svg you have not tray icon. If you install it then tray icon is visible, so maybe its still using qt4 for some reason.

@hluk
Copy link
Owner

hluk commented Oct 31, 2017

@matteotanca What does copyq --version print? (Qt 4 or Qt 5?)

Maybe the library that provides indicator compatibility for Qt 5 tray requires Qt 4 -- it's still odd that it needs library for SVG (libqt4-svg) because the tray icons are installed also in PNG format (looks like it picked wrong format).

@genachka
Copy link

@matteotanca I already had libqt4-svg installed, still no icon:
libqt4-svg is already the newest version (4:4.8.7+dfsg-5ubuntu2).

@l4r1k4
Copy link

l4r1k4 commented Nov 1, 2017

I did an apt purge copyq and deleted .config/copyq from my home.
Then i purged libqt4-svg and reinstalled copyq.
I can see the tray icon and it's working fine.
Maybe i was inheriting something wrong from an old version.

CopyQ Clipboard Manager v3.1.2 (hluk@email.cz)
Built with: Qt 5.5.1, LibQxt 0.7.0

@genachka
Copy link

@matteotanca followed your steps, didn't help me. I then purged and cleaned copyq from my environment and upgraded to 17.10. In 17.10 it now works. Don't know for sure if it was because of clean up or just something that is different with the upgrade to 17.10 but in the end it works now.

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

No branches or pull requests

5 participants