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

System tray icon appears during the backup, but with no icon #1098

Closed
mattalxndr opened this issue Jul 20, 2020 · 29 comments
Closed

System tray icon appears during the backup, but with no icon #1098

mattalxndr opened this issue Jul 20, 2020 · 29 comments
Assignees
Labels
Bug Distro-Specific only for certain distributions, desktop environments or display servers

Comments

@mattalxndr
Copy link

mattalxndr commented Jul 20, 2020

When a backup happens, a new system tray icon appears, and when the backup finishes, it disappears. But the icon is invisible, it just looks like an empty space in between two other icons. When I right click it, I do get the backintime menu.

My crontab is leaving this in its log:

Jul 20 10:35:01 j crond[80616]: pam_unix(crond:session): session opened for user root by (uid=0)
Jul 20 10:35:01 j CROND[80617]: (root) CMD (/usr/sbin/nice -n19 /usr/sbin/ionice -c2 -n7 /usr/sbin/backintime backup-job >/dev/null)
Jul 20 10:35:01 j CROND[80616]: pam_unix(crond:session): session closed for user root
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Lock
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Take a new snapshot. Profile: 1 Main profile
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Call rsync to take the snapshot
Jul 20 10:35:01 j python[80629]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Jul 20 10:35:01 j python[80629]: QPainter::begin: Paint device returned engine == 0, type: 2
Jul 20 10:35:01 j python[80629]: QWidget::render: Cannot render with an inactive painter
Jul 20 10:35:01 j python[80629]: QSystemTrayIcon::setVisible: No Icon set
Jul 20 10:35:08 j python[80624]: backintime (root/1): INFO: Save config file
Jul 20 10:35:08 j python[80624]: backintime (root/1): INFO: Save permissions
Jul 20 10:35:16 j python[80624]: backintime (root/1): INFO: Create info file
Jul 20 10:35:18 j python[80624]: backintime (root/1): INFO: Unlock

Linux version 5.5.7-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Sat, 29 Feb 2020 19:06:02 +0000

@KardinalReusen
Copy link

I can confirm this

@TheTimeWalker
Copy link
Contributor

What DE and icon theme are you using? It seems fine on my end

@KardinalReusen
Copy link

Budgie DE with Papirus icon theme.

@karma-riuk
Copy link

I can confirm this too. I have no DE (running Arch + Qtile) and the icon I use are Adwaita, Breeze and Papirus (with Papirus being the main one).

@protist
Copy link

protist commented Jun 9, 2021

Also confirmed for KDE on Arch. For me the icon has been missing for a few years now. Similar messages in journalctl as OP.

Jun 09 12:00:02 hostname python[910373]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Jun 09 12:00:02 hostname python[910373]: QPainter::begin: Paint device returned engine == 0, type: 2
Jun 09 12:00:02 hostname python[910373]: QWidget::render: Cannot render with an inactive painter
Jun 09 12:00:02 hostname python[910373]: QSystemTrayIcon::setVisible: No Icon set

@Key-Snapper

This comment was marked as off-topic.

@protist

This comment was marked as off-topic.

@emtiu emtiu added the systray label Sep 12, 2022
@emtiu emtiu added Distro-Specific only for certain distributions, desktop environments or display servers Bug Feedback needs user response, may be closed after timeout without a response labels Sep 22, 2022
@emtiu
Copy link
Member

emtiu commented Sep 22, 2022

Hi, thanks for your reports. This is a very tricky issue to debug, I've tried to summarize current knowledge in #1306.

For all of those affected, it would help if you could:

  1. Check if this problem still affects you, and if yes:
  2. Please give your:
    • backintime version,
    • distro and version,
    • Desktop Environment and version (or window/tray manager if you don't have a DE)
    • graphics server (X11 or Wayland).
  3. More log output, if you find something the looks relevant.

Thanks a lot! :)

@protist
Copy link

protist commented Sep 23, 2022

@emtiu Do you mean add this info here, or in the linked issue? If here, then, yes, I am still affected.

  • backintime 1.3.2
  • Arch Linux, up-to-date
  • KDE Plasma 5.25.5
  • X11

@emtiu
Copy link
Member

emtiu commented Sep 23, 2022

@emtiu Do you mean add this info here, or in the linked issue? If here, then, yes, I am still affected.

  • backintime 1.3.2
  • Arch Linux, up-to-date
  • KDE Plasma 5.25.5
  • X11

Thanks, that's very helpful! :) I've updated the info in #1306 accordingly. I'll have to get a Virtual Machine with Arch running to try and reproduce.

From your logs, I see that your backintime systray icon is missing for a job that's running for the root user. Could you check if the same thing happens when there's a backintime job for for your regular user (the one running KDE)?

@msjr65
Copy link

msjr65 commented Sep 24, 2022

Same issue here, with latest versions of

  • Arch
  • Cinnamon
  • X11
    BiT (root) also does not have an icon in the panel
    image

But the icon is there when opening BiT (non-root)
image

@buhtz
Copy link
Member

buhtz commented Sep 24, 2022

On Debian 11 (stable).

Running as root the icon in systray looks like this
grafik
The same icon is used in the toolbar of "root" backintime-qt.

As user the icon looks like this
grafik
The same icon is used in the toolbar of "user" backintime".
This "user" icon is also used as the application icon (?) in the applications menu of XFCE. Also the "Back In Time (root)" entry in that menu use the user icon.

I couldn't find any of that icons in "qt/icons". So I assume this are default icons used by the desktop environment and its theme.

Because of that I assume that user and root do use different themes on the same desktop environment. Or root doesn't use any theme but the desktop environments fallback theme because no explicit theme is configured for root. Root usually doesn't use the desktop environment.

For me the title of that Issue is misleading.

This is a Qt thing. BIT use a name/constant to get an icon. It doesn't load a file. Qt itself does load the correct icon based on the used desktop environment and configured theme (or system icon folder). The icons name is "document-save".

BIT_LOGO = QIcon.fromTheme('document-save')

Maybe the https://github.com/PapirusDevelopmentTeam/papirus-icon-theme people have an idea about it?

@emtiu
Copy link
Member

emtiu commented Sep 24, 2022

Thanks, @msjr65, that's very helpful! I've updated my summary in #1306.

@buhtzz: See #1306 for my current best understanding of the situation. It's very similar to yours.

@protist
Copy link

protist commented Sep 25, 2022

From your logs, I see that your backintime systray icon is missing for a job that's running for the root user. Could you check if the same thing happens when there's a backintime job for for your regular user (the one running KDE)?

I just created a job for my regular user, and the tray icon does display in this case. I agree that's it's likely some issue with the root user not having a theme defined.

Again, I'm not sure if I should comment here to prevent polluting #1306, but I tested installing qt5ct, exporting the variable in backintime, then restarting. However, this didn't fix the icon for me (although it did make all the text in the main window massive).

Also, I slightly disagree with your comments in #1306, specifically

6 rolling-release/DIY distros, thus difficult to reproduce

I've been experiencing this in Arch Linux for at least the last four years, so I think it's pretty easy to reproduce, at least based purely on distro!

@aryoda
Copy link
Contributor

aryoda commented Nov 22, 2022

@KardinalReusen @karma-riuk @mattalexx @protist @msjr65

Could you please follow my instructions here to diagnose the problem:

#1306 (comment)

THX!

I #1236 (comment) installing qt5ct, exporting the variable in backintime, then restarting. However, this didn't fix the icon for me (although it did make all the text in the main window massive).

For this to work you have to start the qt5ct GUI, select an icon theme and click on "apply". By default there seems to be no icon theme selected and you see only text (or empty buttons)...

@protist
Copy link

protist commented Nov 23, 2022

Thanks @aryoda.

Running the following

$ sudo backintime --profile-id 1 --debug backup-job

shows no icon in the tray. Oddly enough there was no empty space in the tray either. If I manually launch the GUI for backintime (root), then click "Take snapshot", then again there is no icon in the tray, but there is an empty space where it should be, and I can hover over it and see the hints. This is the normal situation.

$ xdpyinfo > /dev/null && echo $?
0

Running the command "For BiT running as root with X11 as display server:"

QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
Display Server=None
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_STYLE_OVERRIDE=None
QT active style: fusion
QT fallback style: hicolor
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
themeSearchPaths: ['/usr/share/icons', ':/icons']
fallbackSearchPaths: ['/usr/share/pixmaps']
Is SystemTray available: True
has theme icon <document-save>: False

@msjr65
Copy link

msjr65 commented Nov 23, 2022

@protist Exactly the same results for me

@aryoda
Copy link
Contributor

aryoda commented Nov 23, 2022

Running the following [as user]

$ backintime --profile-id 1 --debug backup-job

shows no icon in the tray.

You seem to use BiT (root) for backups and BiT (root) does not share the same config/profiles with BiT "user".

If no profile is configured (here: running as normal user) the sys tray icon is not shown.

To find out that no config/profile is configured just start BiT GUI as user and you will get this kind of message:

Screenshot from 2022-11-24 00-45-33

Can you confirm this?

@protist
Copy link

protist commented Nov 24, 2022

You seem to use BiT (root) for backups and BiT (root) does not share the same config/profiles with BiT "user".

This is correct. BiT (root) uses my config in /root/.config/backintime.

If no profile is configured (here: running as normal user) the sys tray icon is not shown.

To find out that no config/profile is configured just start BiT GUI as user and you will get this kind of message:

Can you confirm this?

I'm not exactly sure what you are asking. I do have BiT configured for both root and a normal user. I cannot see the icon when running as root. When running as a normal user it appears fine.

@aryoda
Copy link
Contributor

aryoda commented Nov 24, 2022

I'm not exactly sure what you are asking. I do have BiT configured for both root and a normal user. I cannot see the icon when running as root. When running as a normal user it appears fine.

I thought that backintime --profile-id 1 --debug backup-job does not show the sys tray icon (at least for a few seconds) so I am trying to figuring out the reason with my question.

But if you have set up a config for BiT "user" too than my assumed missing config is wrong.

Could you please show me the results this script to compare the theme settings of the user vs. root? THX!

python3 -c "
from PyQt5.QtGui import QIcon;
from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory;
import os
env_var = 'XDG_SESSION_TYPE'; print(f'Display Server={os.environ.get(env_var)}');
qapp = QApplication(['']);
print((f'QT QPA platform plugin: {qapp.platformName()}'));
env_var = 'QT_QPA_PLATFORMTHEME'; print(f'QT_QPA_PLATFORMTHEME={os.environ.get(env_var)}');
env_var = 'QT_STYLE_OVERRIDE'; print(f'QT_STYLE_OVERRIDE={os.environ.get(env_var)}');
print(f'QT active style: {qapp.style().objectName()}');
print(f'QT fallback style: {QIcon.fallbackThemeName()}');
print(f'QT supported styles: {QStyleFactory.keys()}');
print(f'themeSearchPaths: {str(QIcon.themeSearchPaths())}');
print(f'fallbackSearchPaths: {str(QIcon.fallbackSearchPaths())}');
print(f'Is SystemTray available: {str(QSystemTrayIcon.isSystemTrayAvailable())}');
icon_name = 'document-save'; print(f'has theme icon <document-save>: {str(QIcon.hasThemeIcon(icon_name))}');"

@protist
Copy link

protist commented Nov 24, 2022

Sorry @aryoda I realise now I was unclear. I'll go back and edit, but yes, above I was running backintime --profile-id 1 --debug backup-job as root. It does work (i.e. the profile is set up), but there is no icon.

Running your script (as user):

QSettings::value: Empty key passed
QSettings::value: Empty key passed
Display Server=tty
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_STYLE_OVERRIDE=None
QT active style: breeze
QT fallback style: breeze
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
themeSearchPaths: ['/home/protist/.local/share/icons', '/usr/share/icons', '/home/protist/.icons', ':/icons']
fallbackSearchPaths: []
Is SystemTray available: True
has theme icon <document-save>: True

@aryoda
Copy link
Contributor

aryoda commented Nov 24, 2022

The problem is that Qt5 as root is choosing the Qt5-built-in style "fusion" as default which lacks some icons:

QT active style: fusion
QT fallback style: hicolor
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
has theme icon <document-save>: False

The fallback style hicolor does also not provide the BiT icon (named document-save) required for the sys tray icon.

When running BiT as user Qt5 chooses the Breeze icon theme from Arch which does contain the icon.

BiT does internally fall back by trying to use another theme that contains all icons but if none of the fall-back themes is installed it uses oxygen (even if it is not [fully] installed!):

backintime/qt/icon.py

Lines 19 to 22 in 675c8b4

for theme in ('ubuntu-mono-dark', 'gnome', 'oxygen'):
if not QIcon.fromTheme('document-save').isNull():
break
QIcon.setThemeName(theme)

A user-side fix would be to install at least the oxygen icon theme of your distro which contains all standard icons required by BiT. On Arch this should be the package oxygen-icons (but I am not sure).

Could you please try to install oxygen-icons (or a package that sounds like "oxygen icons theme", see https://aur.archlinux.org/packages?O=0&L=0&C=17&K=icon-theme&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go), restart and check if the sys tray icon is then correctly shown in BiT (root)?

On my side I have to fix the buggy fall-back theme activation logic somehow...

@protist
Copy link

protist commented Nov 24, 2022

A user-side fix would be to install at least the oxygen icon theme of your distro which contains all standard icons required by BiT. On Arch this should be the package oxygen-icons (but I am not sure).

Could you please try to install oxygen-icons (or a package that sounds like "oxygen icons theme", see https://aur.archlinux.org/packages?O=0&L=0&C=17&K=icon-theme&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go), restart and check if the sys tray icon is then correctly shown in BiT (root)?

Yes, that's exactly it! The package is indeed oxygen-icons, and it's in the official repos. After installing, I actually didn't need to restart, although I killed /usr/share/backintime/qt/serviceHelper.py (whatever that is), just in case. After launching BiT again, I do indeed have a backup icon.

@msjr65
Copy link

msjr65 commented Nov 24, 2022

Installing oxygen-icons fixed it for me too, same as for @protist
Thank you so much @aryoda !!!

@aryoda
Copy link
Contributor

aryoda commented Nov 25, 2022

@protist @msjr65 Great to hear it works now and THX for testing!

Did the installation of the oxygen-icons change the look & feel of Arch or any other apps (I don't hope so)?

I want to update our documentation of (weak) installation dependencies...

@msjr65
Copy link

msjr65 commented Nov 25, 2022

Did the installation of the oxygen-icons change the look & feel of Arch or any other apps (I don't hope so)?

Not on my side (Arch + Cinnamon).

@protist
Copy link

protist commented Nov 25, 2022

Nothing obvious for me either @aryoda (Arch + KDE Plasma)

@aryoda
Copy link
Contributor

aryoda commented Jul 17, 2023

I have fixed all known issues (hopefully) with my PR #1480 and this issue should be fixed too with that now.

Re-testing and feed-back welcome (currently only on dev branch)!

@aryoda
Copy link
Contributor

aryoda commented Sep 4, 2023

I am closing this now as fixed.

Please open a new issue in case of any problems (to get rid of this and the other related issues that are old and have along history of discussions)...

@aryoda aryoda closed this as completed Sep 4, 2023
@buhtz buhtz removed the Feedback needs user response, may be closed after timeout without a response label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Distro-Specific only for certain distributions, desktop environments or display servers
Projects
None yet
Development

No branches or pull requests

10 participants