Index: src/main.cpp =================================================================== RCS file: /cvsroot/qjackctl/src/main.cpp,v retrieving revision 1.34 diff -u -r1.34 main.cpp --- src/main.cpp 21 May 2008 15:24:45 -0000 1.34 +++ src/main.cpp 8 Jun 2008 20:04:05 -0000 @@ -40,7 +40,7 @@ #include #include -#define QJACKCTL_XUNIQUE "qjackctlMainForm_xunique" +#define QJACKCTL_XUNIQUE "qjackctlApplication" #endif @@ -94,7 +94,13 @@ } #if defined(Q_WS_X11) m_pDisplay = QX11Info::display(); - m_aUnique = XInternAtom(m_pDisplay, QJACKCTL_XUNIQUE, false); + QString sUnique = QJACKCTL_XUNIQUE; + const char *pszServerName = ::getenv("JACK_DEFAULT_SERVER"); + if (pszServerName) { + sUnique += '_'; + sUnique += pszServerName; + } + m_aUnique = XInternAtom(m_pDisplay, sUnique.toUtf8().constData(), false); XGrabServer(m_pDisplay); m_wOwner = XGetSelectionOwner(m_pDisplay, m_aUnique); XUngrabServer(m_pDisplay);