pop-os / cosmic-panel

WIP
GNU General Public License v3.0
105 stars 19 forks source link

FR: only allow one instance of an applet across all panel #201

Closed wiiznokes closed 2 months ago

wiiznokes commented 2 months ago

It will be useful for my clipboard-manager, because the db will be locked

wash2 commented 2 months ago

Could the clipboard-manager exit without an error when there is an existing instance of it already? The single-instance feature run_single_instance method isn't currently part of the applet module in libcosmic, but it could be a good solution for this that doesn't require special configuration in the panel.

wiiznokes commented 2 months ago

Yes, i believe it could works, but it would be ideal to not show an option to add clipboard-manager if it is already present in on the panel config, to avoid confusion where an applet is present on the list, but not visible on the screen. But i understand it's very low priority

wash2 commented 2 months ago

Yes, i believe it could works, but it would be ideal to not show an option to add clipboard-manager if it is already present in on the panel config

Settings should not show applets to be added to the panel if they're already added to the panel, but there is no restriction to adding it to the dock when it's already on the panel.

wiiznokes commented 2 months ago

Settings should not show applets to be added to the panel if they're already added to the panel, but there is no restriction to adding it to the dock when it's already on the panel.

Yes i know, i was talking about not showing it in the dock for example

wash2 commented 2 months ago

Some people would like applets to appear in both panel and dock, an example is the application library button. I'm not sure that this could be a default behavior. In the future, it could possibly being an option for an applet to opt into in its desktop file, similar to other applet keys.

wiiznokes commented 2 months ago

Some people would like applets to appear in both panel and dock, an example is the application library button. I'm not sure that this could be a default behavior. In the future, it could possibly being an option for an applet to opt into in its desktop file, similar to other applet keys.

Yeah of course, sorry for the confusion

wiiznokes commented 2 months ago

I'm going to close this because I didn't think about the 2 monitors setup, with a duplicate panel. So each applet should support multiple instances imo. I guess i will use sqlite, they support multiple process access apparently

wiiznokes commented 2 months ago

Btw, could the first applet process be reused in this case 🤔