r7-labs / R7.Webmaster

Webmaster's desktop productivity tools
GNU General Public License v3.0
1 stars 0 forks source link

Unable to start app if another instance already running in different desktop session #17

Closed roman-yagodin closed 6 years ago

roman-yagodin commented 6 years ago

Unable to start app if another instance already running in different desktop session as both are share same wait handle.

roman-yagodin commented 6 years ago

It's probably better to use session id instead of username for this, but System.Diagnostics.Process.GetCurrentProcess().SessionId always returns 0 for different desktop sessions on Linux (Mono). Environment.GetEnvironmentVariable ("XDG_SESSION_ID") looks like a promising fallback option.