anaynayak / buildnotify

A system tray based build status notification app for cctray.xml feeds.
https://anaynayak.github.io/buildnotify/
Other
29 stars 7 forks source link

Status Indicator Disappears on Session Restart in 18.0.4 #67

Closed ghost closed 3 years ago

ghost commented 5 years ago

As the title says. Apparently this issue is not unique to this little widget. It's a common enough problem with app indicators that there's an issue for it already, with an extensive comment thread: https://github.com/ubuntu/gnome-shell-extension-appindicator/issues/75

From what I've gleaned in that thread, it should be possible to update buildnotify to use newer gnome APIs that detect when session has been restarted or when it's been unlocked such that you can re-populate the top bar with the status icon.

For now, you can work around this issue by just restarting gnome-shell while logged in. But this is very disruptive since doing so can either close certain windows or cause them to move around, requiring readjustment.

anaynayak commented 5 years ago

Thanks for the link to the comment thread. Buildnotify uses PyQt as the underlying framework. From the thread, it seems that the Qt specific issue is https://bugreports.qt.io/browse/QTBUG-63065 and is resolved in 5.9 . Would you be able to confirm the version installed ? I'll try to reproduce this on a vm.

JonnyRa commented 5 years ago

I've also had this issue and had abandoned it for a while. I thought that dash-to-panel may have been involved but that might have been incorrect. After trying to get this going again after a while my notifications seem to be sticking around now I've updated dash-to-panel, however when running buildnotifyapplet.py I have to restart gnome shell (alt+F2 then r) to get buildnotify to come up

ghost commented 5 years ago

Currently away from work where we make extensive use of this widget. Will report back in the next couple days when I can get on or ssh into a machine where it's installed. So far the only thing I can tell you is that I don't believe we're using any version of QT other than what comes with Ubuntu 18.0.4 by default. But I'll let you know which one we're using when it's possible, and if upgrading the framework solves the issue.

ghost commented 5 years ago

It looks like our systems do have a version of pyqt about 5.9 installed, unless I'm looking in the wrong place: screenshot from 2018-11-29 14 42 14

I also checked the version of qt installed, and it's also above 5.9: screenshot from 2018-11-29 14 46 03

anaynayak commented 5 years ago

I'm trying to replicate this issue on a VM with Ubuntu 18.04 but it still seems to be working :(

Steps:

  1. Login to Ubuntu VM
  2. Launch Buildnotify from the cli
  3. Lock machine
  4. Unlock machine
  5. The icon should disappear from the menubar ?

FYI, I'm not using dash-to-panel and Buildnotify is latest master (not from apt-get).

ghost commented 5 years ago

I'm not sure what the difference could be. We're using buildnotify from a manual build as well, not the system package version. We do run multiple setup scripts for our workstations, but that's mostly to get stuff like rubymine installed, and I doubt that's the cause of the problem if the dependencies are all okay.

FYI, our issue has nothing to do with dash-to-panel, we've not got that extension installed. But here's what we do have... image

Any ideas for what else I chould check configuration-wise?

anaynayak commented 5 years ago

i tried to install a similar set of tools but wasn't able to replicate it. Can you try replicating it by running the following script in a terminal ? This will add an extra 'undo' icon to the system tray. Let me know if you can replicate it with the same steps.

import sys
from PyQt5.QtWidgets import QSystemTrayIcon, QApplication
from PyQt5.QtGui import QIcon

class BuildNotifyTest:

    def __init__(self, app):
        self.app = app
        self.tray = QSystemTrayIcon(QIcon.fromTheme("edit-undo"), self.app)
        self.tray.activated.connect(QApplication.instance().quit)

        self.tray.show()                

if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setQuitOnLastWindowClosed(False)
    buildnotify = BuildNotifyTest(app)
    sys.exit(buildnotify.app.exec_())
ghost commented 5 years ago

I tried copying that script into a .sh file and running it with bash <script_name>... image This is the output... image FWIW, upon running that script the cursor also turned a strange cross shape and didn't appear to do anything when clicking on the top bar or terminal window.

EDIT: I looked at the script again and noticed you wrote it to take in some argument called 'app'? I'm guessing that's the executeable at /usr/local/bin/buildnotifyapplet.py? Anyway, I tried running it again while passing that in as an argument. I still noticed the cursor changing to a cross shape. And there's some interesting output, because it looks like it can't find some libraries. Unless I'm supposed to run it under that directory...? image For the hell of it I also tried that. Running this script under that directory, I mean. Still the same result, the cursor turns into a cross shape and the output in the terminal is the same. image I even gave it sudo permissions. image

anaynayak commented 5 years ago

I'm sorry. I should have been more explicit. It is a python script. I have simplified the steps a little. Can you instead run the following commands ?

cd ~
wget https://gist.githubusercontent.com/anaynayak/419d817bb24f8b707f3cba1b5c91d384/raw/162f148e1c28074a697d0fff1c1f5c278d1e45c6/buildnotifytest.py
python buildnotifytest.py
ghost commented 5 years ago

I ran the commands, and there's no output. It seems to run without issue. However, no indicator appears in the top bar until I restart gnome shell, at which point I can see this (clock is moved from original position because of extensions) image

anaynayak commented 5 years ago

Thats interesting. I was expecting it to experience similar issues w.r.t. icon disappearing on lock/unlock. I'm not sure what else to try :(

ghost commented 5 years ago

Ah, I'm sorry, by "It seems to run without issue" I meant that the command itself didn't output any errors. In fact, there was no output at all, but it seemed to hang in the terminal so I assumed it was running properly. I still had to restart gnome shell to get the icon to show after running the script, AND I had to restart gnome shell again once I restarted my session by locking/unlocking. So basically the issue is reproducible with your script. image

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.