Changeset View
Changeset View
Standalone View
Standalone View
xembed-sni-proxy/fdoselectionmanager.cpp
Show All 16 Lines | |||||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | * | 18 | * | ||
19 | */ | 19 | */ | ||
20 | #include "fdoselectionmanager.h" | 20 | #include "fdoselectionmanager.h" | ||
21 | 21 | | |||
22 | #include "debug.h" | 22 | #include "debug.h" | ||
23 | 23 | | |||
24 | #include <QCoreApplication> | 24 | #include <QCoreApplication> | ||
25 | #include <QDBusConnection> | ||||
26 | #include <QDBusServiceWatcher> | ||||
25 | #include <QHash> | 27 | #include <QHash> | ||
26 | #include <QTimer> | 28 | #include <QTimer> | ||
27 | | ||||
28 | #include <QTextDocument> | 29 | #include <QTextDocument> | ||
29 | #include <QX11Info> | 30 | #include <QX11Info> | ||
30 | 31 | | |||
31 | #include <KSelectionOwner> | 32 | #include <KSelectionOwner> | ||
32 | 33 | | |||
33 | #include <xcb/xcb.h> | 34 | #include <xcb/xcb.h> | ||
34 | #include <xcb/xcb_atom.h> | 35 | #include <xcb/xcb_atom.h> | ||
35 | #include <xcb/xcb_event.h> | 36 | #include <xcb/xcb_event.h> | ||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | 176 | { | |||
182 | m_proxies.remove(winId); | 183 | m_proxies.remove(winId); | ||
183 | } | 184 | } | ||
184 | 185 | | |||
185 | void FdoSelectionManager::onClaimedOwnership() | 186 | void FdoSelectionManager::onClaimedOwnership() | ||
186 | { | 187 | { | ||
187 | qCDebug(SNIPROXY) << "Manager selection claimed"; | 188 | qCDebug(SNIPROXY) << "Manager selection claimed"; | ||
188 | 189 | | |||
189 | setSystemTrayVisual(); | 190 | setSystemTrayVisual(); | ||
191 | | ||||
192 | // send all container windows to background on KWin restart | ||||
193 | QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QStringLiteral("org.kde.KWin"), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForRegistration, this); | ||||
194 | connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, [=](const QString &) { | ||||
195 | // some delay is necesary | ||||
196 | QTimer::singleShot(100, this, [=]() { | ||||
197 | for (auto sniproxy : m_proxies) { | ||||
198 | sniproxy->stackContainerWindow(XCB_STACK_MODE_BELOW); | ||||
199 | } | ||||
200 | }); | ||||
201 | }); | ||||
190 | } | 202 | } | ||
191 | 203 | | |||
192 | void FdoSelectionManager::onFailedToClaimOwnership() | 204 | void FdoSelectionManager::onFailedToClaimOwnership() | ||
193 | { | 205 | { | ||
194 | qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; | 206 | qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; | ||
195 | qApp->exit(-1); | 207 | qApp->exit(-1); | ||
196 | } | 208 | } | ||
197 | 209 | | |||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |