flathub / com.synology.SynologyDrive

https://flathub.org/apps/details/com.synology.SynologyDrive
7 stars 10 forks source link

System tray not on by default issue #1

Closed 00EkZ8 closed 4 years ago

00EkZ8 commented 4 years ago

Not an issue but looking for some guidance. I'm using your code as a template to create a flatpak for another synology app. Did you have issues with the pid files not being created in ~/.SynologyDrive? I have the app building and it will launch once. If you close the ui it will just continuously spawn background processes and never bring the ui to the front again when trying to re-open the app.

00EkZ8 commented 4 years ago

Further testing this flatpak also does the same thing for me. After initial set up launching the program again spawns more and more background tasks but never brings the program ui up again. Fedora 32 Gnome

gregos-winus commented 4 years ago

Hello

I did not have any problem with pid files and you launch the flatpak-ed Synology Drive a folder named ".SynologyDrive" is created in the home folder.

Are you sure your flatpak launch your app?

Some advices I can give you :

00EkZ8 commented 4 years ago

Thank you for the information. Home permissions are good. Launch script, I used yours and modified the needed location for cloud backup. Running the flatpak run -command=bash app doesn't provide much for debugging. But it does allow me to relaunch the app from inside the container and bring the app-ui back without launching a process in the background.

I believe the issue is the PID for the sandbox, and the host PID are different. So when going from the host and using the launcher it doesn't see the PID for sandbox and vice versa.

I tested with the synology drive flatpak and I get the same behaviour of multiple background processes. You can see the PID difference below. I hope that makes sense. This is my first flatpak so it's a learning experience

4786    4777  2 10:19 ?        00:00:01 /home/user/.CloudStationBackup/CloudStation.app/bin/cloud-backup-ui

cat ui.pid 
pid="9"
gregos-winus commented 4 years ago

When I worked on Synology Drive, I never took care of PID. Why do you need to look at it?

What is your problem?? It seems you manage to launch the app and see the UI

00EkZ8 commented 4 years ago

Yes. I am able to launch the app and see the UI once. But once it is closed I can never open it again, it only starts background processes.

If I launch from within the flatpak the UI comes up correctly.

I assumed it was because the sanbox pid is not the same as the host pid, and thus the flatpak keeps launching. This might help explain: https://pastebin.com/TKjfn0by

I installed the synologydrive flatpak from gnome software. At first launch it worked correctly. once I close the UI and attempted to re-open using the launcher it just continually launches background processes.

This is the same issue my flatpak is having.

00EkZ8 commented 4 years ago

I did some testing with Pop_OS 20.04. with the Synology Drive flatpak.

Pop_OS supports tray icons using the extension Ubuntu Appindicators. After closing the drive UI it goes to the top bar in the tray and allows you to re-open from there. If you press super key and re-open using the launcher, another instance will be put in the system tray, and it will also show another process in the terminal like i showed in the pastebin.

Fedora does not show tray icons which is why I thought the processes were background only. Installing the gnome extension "TopIcons Plus Git" allows the tray icon to show and the UI to be brought back to the foreground through the tray icon.

It means the flatpak I have is actually working correctly, but it also means both the SynologyDrive and the one I'm working on does not function correctly on distros without a system tray. For some reason the old .rpm file I have is able to work around this when relaunching from the launcher.

00EkZ8 commented 4 years ago

The rpm I have when installed without the "TopIcons plus Git" extention shows the error auto_updater.log:May 21 21:06:20 [WARNING] main.cpp(113): Does not detect any system tray on this system. in /home/user/.CloudStationBackup/log/auto_updater.log

00EkZ8 commented 4 years ago

I did some more testing with a fresh install of Fedora 32. This is an issue because Fedora does not implement a system tray by default. Adding a gnome extension to implement a system tray makes this issue go away. I've changed the name of the issue to reflect this. Hopefully this makes my original issue more clear. Thank you @gregos-winus I'll close this issue now.