When trying to add more than one systray it correctly complains that one is already registred but add the new systray (or at least a frame for it) nevertheless. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Good catch. Should not be too hard to fix.
Indeed, it seems it does not even require any code ;) Index: plugins/systray/systray.desktop.in.in =================================================================== --- plugins/systray/systray.desktop.in.in (revision 20285) +++ plugins/systray/systray.desktop.in.in (working copy) @@ -5,4 +5,4 @@ _Comment=Show notification icons Icon=xfce-system-info X-XFCE-Module=@INTERNAL_PLUGIN_PATH@/libsystray.so - +X-XFCE-Unique=true
another moment of 'think after send'. This would presumably make systrays on a different screen non-runnable too. If so then, there's another problem: construct cannot tell the panel that initialization failed, so even if we return if another systray is running on this screen the panel will place the item in panels.xml. Which on restarting the panel pops up warnings of systray already registered. Maybe construct needs to be made to return something to allow plugins to signal failure initializing for various reasons. Even it's a simple change it may be too late for 4.4 :(
It was 'X-XFCE-Unique' originally, but someone requested a change for multiple screens. I don't want to change the existing API, but I can add extra macros *_REGISTER_WITH_CHECK() that can give an additional callback to check whether new plugins can be created. I have this locally and it works, but I'm not ready to commit this yet. I'd like to investigate the possibility of having a X-XFCE-Unique-For-Screen flag or something.
Ok, this should now be fixed in revision 20349.