davidedmundson / xembed-sni-proxy

Convert XEmbed system tray icons to SNI icons
GNU General Public License v2.0
32 stars 6 forks source link

Allow only single instance to be running. #27

Closed stativ closed 8 years ago

stativ commented 8 years ago

This should fix the second part of #20 – I introduced a new QSingleApplication class that allows only one running instance.

tehnick commented 8 years ago

Shared memory in GNU/Linux is based on special files in /tmp directory. How will your code work at startup in situation when xembedsniproxy was crashed or killed and a special file in /tmp exists?

tehnick commented 8 years ago

Also the second point was:

Two: We should close if another systray is running

As far as I understand we should check if any other xembed systray manager works, but not only xembedsniproxy.

stativ commented 8 years ago
  1. the application being killed is potentially a problem, but most cases should be caught by atexit and signal handlers (though now I see that I forgot SIGABRT handler)
  2. valid point, I didn't realize somebody may want to run different systray. I suppose this merge request can be thrown away then.
tehnick commented 8 years ago

2) I am not sure if it is a real problem when two xembed systray managers are launched simultaneously, because all systray icons will appear only in one of them.

tehnick commented 8 years ago

1) Probably some additional check might be added for resolving the issue with killed process.

davidedmundson commented 8 years ago

What I don't like is that I should be quitting when I can't claim the _NET_SYSTEM_TRAY atom because any other tray is running.

Once I do that, I get this feature for free.

If I add this, I still need to add the previous code and I get two bits doing the same thing.

It used to work till I ported it to use KWindowSystem which seems to have a bug in it.

davidedmundson commented 8 years ago

Ah, found what was wrong with the way I was quitting. That's now fixed.

Thanks for taking the time to submit the patch, it really is appreciated and I'm sorry I didn't merge it. At least we ended up with a fix.