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

Items missing from the system tray icon right click menu #18074

Closed
sha-265 opened this issue Nov 27, 2022 · 41 comments · Fixed by #18250
Closed

Items missing from the system tray icon right click menu #18074

sha-265 opened this issue Nov 27, 2022 · 41 comments · Fixed by #18250
Assignees
Labels
GUI GUI-related issues/changes OS: Linux Issues specific to Linux distributions
Milestone

Comments

@sha-265
Copy link

sha-265 commented Nov 27, 2022

qBittorrent & operating system versions

qBittorrent: 4.5.0 x64
Operating system: Ubuntu 22.10
Qt: 5.15.6
libtorrent-rasterbar: 2.0.8.0

What is the problem?

In the right click menu of the system tray icon in the notification area, all the items are missing except the Exit button, like this:

image

Steps to reproduce

  1. Run qBittorrent 4.5.0.
  2. Try to right click on the tray icon.
  3. See if all buttons appears or only Exit button.

Additional context

The menu should be like this:
image

Possible workaround: disable the Show qBittorrent in notification area option and than re-enable it. For me all items appears, until next restart of the app.

Log(s) & preferences file(s)

No response

@thalieht thalieht added the OS: Linux Issues specific to Linux distributions label Nov 27, 2022
@sledgehammer999

This comment was marked as off-topic.

@glassez

This comment was marked as off-topic.

@sledgehammer999

This comment was marked as off-topic.

@sledgehammer999
Copy link
Member

Out of curiosity can you also test with official AppImage (download on mainstite)?

@sha-265
Copy link
Author

sha-265 commented Nov 28, 2022

Out of curiosity can you also test with official AppImage (download on mainstite)?

@sledgehammer999, with the AppImage file the right click menu doesn't work at all.

@sha-265
Copy link
Author

sha-265 commented Nov 29, 2022

The system tray icon right click menu is not working also in qBittorrent v4.5.0 installed from PPA on Ubuntu 22.04.

@sledgehammer999
Copy link
Member

Which DE are you using?
I have tried clean VMs of Ubuntu 22.10 (gnome), Xubuntu 22.10 (xfce) and Arch (KDE).
I can't reproduce it. The tray menu works correctly with the PPA version and the AppImage on the above VMs.

Were you using another qbt version before on the same OS? Did it work correctly?

@sha-265
Copy link
Author

sha-265 commented Nov 29, 2022

Which DE are you using?

Both versions (22.04 and 22.10) use Ubuntu's default DE - aka gnome.

Were you using another qbt version before on the same OS? Did it work correctly?

I did. I used v4.4.5 (and older) on the same OS, and it did work correctly.

@sledgehammer999
Copy link
Member

What does the following return?

echo $QT_QPA_PLATFORMTHEME

@sha-265
Copy link
Author

sha-265 commented Nov 29, 2022

appmenu-qt5

@sledgehammer999
Copy link
Member

Is anyone able to do their own compilations? If so, can you try with this patch? patch->#18108

@glassez
Copy link
Member

glassez commented Nov 30, 2022

Is anyone able to do their own compilations? If so, can you try with this patch? patch->#18108

I don't think this patch can fix this issue. I'm thinking on possible solution... Of course it would be nice if someone affected could test it when I'm done.

@Rootdiv
Copy link

Rootdiv commented Dec 1, 2022

I have the same problem.

@Rootdiv
Copy link

Rootdiv commented Dec 4, 2022

In the update dated December 4, 2022, the problem persists.

qBittorrent: 4.5.0 x64
Operating system: Ubuntu Mate 22.04.1
DE: Mate 1.26.0
Qt: 5.15.3
libtorrent-rasterbar: 2.0.8.0
echo $QT_QPA_PLATFORMTHEME -> gtk2

@glassez
Copy link
Member

glassez commented Dec 4, 2022

It looks like there is incompatibility with some DE (tray icon providers used by them). I'll try to find a workaround as soon as I get a similar environment.

@glassez glassez added the GUI GUI-related issues/changes label Dec 4, 2022
@glassez glassez added this to the 4.5.1 milestone Dec 4, 2022
@glassez glassez self-assigned this Dec 4, 2022
@glassez
Copy link
Member

glassez commented Dec 4, 2022

Which DE are you using?
I have tried clean VMs of Ubuntu 22.10 (gnome), Xubuntu 22.10 (xfce) and Arch (KDE).
I can't reproduce it. 

I can't reproduce it on Linux Mint (neither on Cinnamon, nor on Xfce, nor on Mate).

What does the following return?

echo $QT_QPA_PLATFORMTHEME

qt5ct

What does it return for you on mentioned above desktops?

@glassez
Copy link
Member

glassez commented Dec 4, 2022

Same here on Artix 6.0.7 with xfce qBittorrent 4.5.0-1

@MrComexs
Please provide complete info like the Issue author did above:

qBittorrent & operating system versions
qBittorrent: 4.5.0 x64
Operating system: Ubuntu 22.10
Qt: 5.15.6
libtorrent-rasterbar: 2.0.8.0

In the update dated December 4, 2022, the problem persists. Ubuntu Mate 22.04.1 gtk2

@Rootdiv
You too.

I have tried clean VMs of Ubuntu 22.10 (gnome), Xubuntu 22.10 (xfce) and Arch (KDE).
I can't reproduce it. The tray menu works correctly with the PPA version and the AppImage on the above VMs.

What Qt version they are linked with?

@MrComexs
Copy link

MrComexs commented Dec 4, 2022

Same here on Artix 6.0.7 with xfce qBittorrent 4.5.0-1

@MrComexs Please provide complete info like the Issue author did above:

What Qt version they are linked with?

qBittorrent v4.5.0 (64-bit)
Qt 6.4.1
Libtorrent 2.0.8.0
Boost 1.80.0
openSSL 3.0.7
zlib 1.2.13
libtorrent-rasterbar 1:2.0.8-2

OS: Artix 6.0.7

❯ sudo pacman -Q | grep xfce4
libxfce4ui 4.16.1-1
libxfce4util 4.16.0-1
❯ echo $QT_QPA_PLATFORMTHEME
gtk2

I not sure if this matter but here anyway

❯ sudo pacman -Q | grep nvidia
nvidia-dkms 520.56.06-2
nvidia-settings 520.56.06-1
nvidia-utils 520.56.06-2
opencl-nvidia 520.56.06-2
❯ sudo pacman -Q | grep mesa
lib32-mesa 22.2.3-1
mesa 22.3.0-1
mesa-utils 8.5.0-2
 ~              

So for me I only have the exit option in the context menu on the task bar

@Rootdiv
Copy link

Rootdiv commented Dec 4, 2022

@glassez, I'm edited comment #18074 (comment)

@andreymal
Copy link

andreymal commented Dec 4, 2022

This issue is reproducible when starting is slow. I successfully reproduced the problem in a clean VM using Arch Linux + MATE after adding a torrent with 43000 small files.

The version of Qt does not matter. I tried to recompile qBittorrent with Qt5 and Qt6 — the behavior is slightly different, but both are broken.

@glassez
Copy link
Member

glassez commented Dec 5, 2022

I'm not very familiar with Linux world, but apparently there are different backends providing the tray icon functionality, and the problem is with some of them, regardless of the DE itself.

This issue is reproducible when starting is slow. I successfully reproduced the problem in a clean VM using Arch Linux + MATE after adding a torrent with 43000 small files.

Didn't test with real torrent but I added extra delay of 10 secs to emulate it. First the reduced menu is shown while torrents are being loaded (delay isn't expired) and then it is replaced with full menu as expected.

@andreymal
Copy link

@glassez it's not replaced in my clean VM

Click me
qbittorrent-tray.mp4

@glassez
Copy link
Member

glassez commented Dec 5, 2022

@glassez it's not replaced in my clean VM

Click me
qbittorrent-tray.mp4

So what kind of software is responsible for top panel of your desktop?

@andreymal
Copy link

@glassez mate-panel

@mtigas
Copy link

mtigas commented Dec 10, 2022

Same behavior here (missing tray menu items). Have not noticed any particular slowness or any change in behavior after some time; the menu items simply do not appear. This was an upgrade of an existing install, and so I do have several torrents in the app already.

Workaround in original post (Behavior -> "Show qBittorrent in notification area", toggle off, click "Apply", toggle it on, click "Apply") seems to work and causes the menu items to appear properly until the app is restarted.


Fedora 37, with the GNOME Shell DE under Wayland.

Version info, per the "about" dialog box:
qBittorrent v4.5.0 (64-bit)
Qt: 5.15.7
Libtorrent: 2.0.8.0
Boost: 1.78.0
OpenSSL: 3.0.5
zlib: 1.2.12

(I'm using the qBittorrent from the official Fedora repos, which appears to be this build, in case you need more info on what it's built/linked against.)

System tray is the standard gnome-shell-extension-appindicator for gnome shell.

$ echo $QT_QPA_PLATFORMTHEME

(i.e. the env var is not set)

a subset of output from dnf list installed:

adwaita-qt5.x86_64                                   1.4.2-1.fc37                        @fedora                   
gnome-shell.x86_64                                   43.2-1.fc37                         @updates                  
gnome-shell-extension-appindicator.noarch            46-1.fc37                           @fedora                   
gtk2.i686                                            2.24.33-10.fc37                     @fedora                   
gtk2.x86_64                                          2.24.33-10.fc37                     @fedora                   
gtk3.i686                                            3.24.35-1.fc37                      @updates                  
gtk3.x86_64                                          3.24.35-1.fc37                      @updates                  
gtk3-devel.x86_64                                    3.24.35-1.fc37                      @updates                  
gtk4.x86_64                                          4.8.2-2.fc37                        @fedora                   
libadwaita-qt5.x86_64                                1.4.2-1.fc37                        @fedora                   
qbittorrent.x86_64                                   1:4.5.0-1.fc37                      @updates                  
qgnomeplatform-qt5.x86_64                            0.9.0-5.fc37                        @updates                  
qt5-qtbase.x86_64                                    5.15.7-1.fc37                       @updates                  
qt5-qtbase-common.noarch                             5.15.7-1.fc37                       @updates                  
qt5-qtbase-gui.x86_64                                5.15.7-1.fc37                       @updates                  
qt5-qtdeclarative.x86_64                             5.15.7-1.fc37                       @updates                  
qt5-qtsvg.x86_64                                     5.15.7-1.fc37                       @updates                  
qt5-qtwayland.x86_64                                 5.15.7-1.fc37                       @updates                  
qt5-qtx11extras.x86_64                               5.15.7-1.fc37                       @updates                  
qt5-qtxmlpatterns.x86_64                             5.15.7-1.fc37                       @updates                  
qt5-srpm-macros.noarch                               5.15.7-1.fc37                       @updates                  
rb_libtorrent.x86_64                                 2.0.8-1.fc37                        @updates                  

@glassez

This comment was marked as off-topic.

@MrComexs

This comment was marked as off-topic.

@glassez

This comment was marked as off-topic.

@MrComexs
Copy link

MrComexs commented Dec 11, 2022

Pacman

pacman -Ss qbittorrent returns nothing for me.

its on the Community arch repo which sould be enabled by default

❯ sudo pacman -Sys qbittorrent
:: Synchronizing package databases...
 gremlins is up to date
 system is up to date
 world is up to date
 galaxy is up to date
 extra is up to date
 community is up to date
community/qbittorrent 4.5.0-1 [installed]
    An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar
community/qbittorrent-nox 4.5.0-1
    An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar, w/o gui

I made a VM but I wasn't able to make the same problem happen.

I got rid of the Status Tray Plugin and then re-added it to my panel and now I see all of the menu options but when I quit qbit and re launch it I get the same problem as before. I have also unchecked Show qBittorrent minimized in the Behavior Preferences and when I recheck it I see the all of the menu options but when I quit qbit it goes back to the same problem.

I might reinstall qbittorrent later today to see if that fixes it but I'm not sure since I haven't been able to find a way to replicate my problem tell me what I should do. I don't mind keeping this bug until we get it fixed?

@andreymal
Copy link

I made a VM but I wasn't able to make the same problem happen.

@MrComexs try to add some torrents, preferably with a large number of files (as I mentioned before)

@glassez
Copy link
Member

glassez commented Dec 11, 2022

Well, I seem to have noticed some regularity that I was able to reproduce on two different Linux systems:

  1. if there are no torrents in qBittorrent, then tray menu always works correctly.
  2. if there are any torrents (one was enough for me), then tray menu works correctly when qBittorrent is first started after the OS is loaded, but it does not work correctly on every next restart of qBittorrent until the OS is rebooted (or until you delete all torrents).

Can anyone confirm this behavior?

@glassez

This comment was marked as off-topic.

@andreymal
Copy link

@glassez in my PC and clean VM, the menu does not work correctly even on first start. I guess my torrents are "big enough" to consistently trigger some race condition

@glassez
Copy link
Member

glassez commented Dec 11, 2022

@andreymal
How does it work on your system if you don't have a single torrent?

@andreymal
Copy link

@glassez running a separate instance with a empty home directory works well

qbittorrent-empty-home.mp4

@glassez
Copy link
Member

glassez commented Dec 11, 2022

@andreymal
Could you also test it with single not so big torrent? Does it works correctly once after OS restart?
Could you provide your "big" torrent to me for testing or it is private?

@andreymal
Copy link

@glassez I tried to use this simple Python script to generate many small files:

from pathlib import Path
d = Path("many-files")
d.mkdir(exist_ok=True)
for num in range(10000):
    (d / f"{num}.txt").write_text(f"File #{num}\n", "utf-8")

Then I just created and added a torrent in qBittorrent (no need to download it, you can even delete the original files).

The more files created, the greater the chance of triggering this bug.

10000 files are enough for me to trigger this bug, but note that I'm using an HDD (I guess the behavior may be different on SSD)

(I also tried to create a torrent with 500000 files, but it failed with bencoded item count limit exceeded lol)

@MrComexs
Copy link

MrComexs commented Dec 12, 2022

Well, I seem to have noticed some regularity that I was able to reproduce on two different Linux systems:

1. if there are no torrents in qBittorrent, then tray menu always works correctly.

2. if there are any torrents (one was enough for me), then tray menu works correctly when qBittorrent is first started after the OS is loaded, but it does not work correctly on every next restart of qBittorrent until the OS is rebooted (or until you delete all torrents).

Can anyone confirm this behavior?

@glassez

  1. Yes
  2. With only 1 torrent in the BT_backup folder (32~GiB but only 4 files downloaded 1 half downloaded and 3 not downloaded) I would never get the bug to occur
  3. it took me 30~ torrents in the BT_backup folder for the bug to occur then when I rebooted it amount of torrent need for the bug to occur was bumped up to 35~. Then when I rebooted it work just fine until I killed it and relaunched it then the bug occur. If I rebooted it for the third or more times I don't get the bug until I killed it and relaunch it.
  4. I re-add all my torrents back into the BT_backup folder all 67 of them then no matter how many times I reboot, I only see the exit menu option.
    (number 3 and 4 are both number 2)

Note: I moved the .torrent and .fastresume file out of the BT_backup and add 5 torrents at a time until I got the bug to occur. I still left the downloaded files in there respective categories folder but only moved the .torrent and .fastresume files out of the BT_backup folder so I don't have to re-download the torrents content.

@glassez
Copy link
Member

glassez commented Dec 18, 2022

Well, after agonizing attempts to figure out what's what, I came to understand that the problem is hidden somewhere in the depths of Qt (platform plugin), so I won't be able to achieve a "clean" solution to this problem.
All I can do is completely reload the system tray icon if necessary to replace the menu (i.e. after all torrents are restored). Now #18250 implements that. The disadvantage is the visual effect (the icon disappears, and then reappears).
Another way would be to have no menu at all until the torrents are restored so I can show regular menu.
So I'm waiting for your feedback. It would also be very helpful if you could test it yourself to confirm that it behaves as intended on your platforms as well.

P.S. I explain for those who have not understood this so far that since version 4.5, the application startup (restoring existing torrents) process has been significantly optimized, one of the aspects of which is that the main UI (including the regular tray icon menu) becomes available only at the end of the startup, and during the startup there is only minimal UI functionality displaying the current progress and allowing you to interrupt it, i.e. close the application.

@MrComexs
Copy link

MrComexs commented Jan 3, 2023

I was able to get the menu to (kinda) work again for me but all I did was give qBittorrent more ram.
so by default Physical memory (RAM) usage limit (?) = 512 I set it to Physical memory (RAM) usage limit (?) = 1024 without restarting qBittorrent the menu is working as it should.

@glassez
Copy link
Member

glassez commented Jan 3, 2023

I set it to Physical memory (RAM) usage limit (?) = 1024 without restarting qBittorrent the menu is working as it should.

I wonder how it will behave after restarting qBittorrent?

glassez added a commit that referenced this issue Jan 22, 2023
glassez added a commit to glassez/qBittorrent that referenced this issue Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI GUI-related issues/changes OS: Linux Issues specific to Linux distributions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants