dhruv8sh / arch-update-checker

Plasma 6 applet to check for AUR and Arch updates
GNU General Public License v2.0
70 stars 5 forks source link

Multiscreen only updates one widget #41

Closed JurgenCruz closed 6 days ago

JurgenCruz commented 2 months ago

I have a 3 monitor setup with the panels and task bars. If I use the widget in screen one to update the system, that widget no longer shows updates, but the widgets in the other screens still show updates until I manually click and search updates from the other instance of the widget.

Also, I had an instance where I configured the widget but then the configuration wizard came up again and ask me to configure again. At the moment I thought it was just a glitch but now I'm wondering if it was asking me to configure the two separate instances for each screen. I'm not sure on this last one, just an FYI. Also, I don't use virtual desktops, but it could also be a problem there, not only for multiple monitors, but multiple desktops.

Thanks!

dhruv8sh commented 2 months ago

I see. Virtual desktops don't have this issue. On multiple screens, Plasma assumes the same widgets on two different screens as two different instances. This can be solved by keeping track of a local cache. Currently, there is no caching implemented by the applet and is planned for a later date. I will notify you when it is.

dhruv8sh commented 6 days ago

This feature will not be implemented due to the following reasons:

What you can do is, enable the applet inside only one tray, or only enable notifications for one if using more than one instances.

JurgenCruz commented 6 days ago

Hi,

From your points above:

  1. What is the use case of having one screen with AUR wrappers enabled, and another screen having AUR wrappers disabled? I have the exact configuration in all 3 instances, and I had to manually copy the configuration for all 3.
  2. Not sure why caching will make it slow and bloated if today it already needs 3 files for 3 screens to keep the config separated. Can't this be solved by using a singleton that reads a single config file for all instances?
  3. If the above singleton is shared across the instances then you don't need to worry about the instances writing the file at once. I don't see a race condition happening, you would need to open the config screen of 2 instances at the same time and clicking "Save" fast enough in both dialogs for a write race condition to happen.

Sharing the data should make it more efficient and less bloated, not consume more resources.

I'm looking at it from this perspective: If I have discord open and I get a message, a red dot appears in the tray for all trays. If I read it, all the trays are updated and the read dot disappears. if I click any of them, it will open/focus the discord window.

Or take the KDE clipboard tray icon, whichever icon I click, shows me the clipboard and can clear it. If I clear the clipboard in one tray, it clears it in all trays. It is expected that there is a single process owning the data, and the 3 icons in the trays just communicate with this process.

BTW, if I click the settings button in the clipboard widget it will open a single dialog for all 3 instances. it will not open a second dialog. the settings are shared.

dhruv8sh commented 6 days ago

You are approaching the issue as if this project is an app. Here's an idea to solve it. Write configs into a file instead, read from it for all of them. But then I would have to design all the config pages and commands to match it (again). Are you willing to help with that if you really want it?

JurgenCruz commented 5 days ago

I understand. The scope of the project was not meant to be an app, just a widget and the limitations of the widget system prevent such use cases. Even if you shared the config file, like you mention, the cache would be a problem. So I'm fine with closing this issue. I guess I can just lower the refresh time so the icons refresh faster and they sync naturally.