Merge branch 'Plasma/5.17'

wilder-5.18
Konrad Materka 6 years ago
commit cacc7dd3b5
  1. 14
      xembed-sni-proxy/fdoselectionmanager.cpp
  2. 16
      xembed-sni-proxy/sniproxy.cpp
  3. 1
      xembed-sni-proxy/sniproxy.h

@ -22,9 +22,10 @@
#include "debug.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusServiceWatcher>
#include <QHash>
#include <QTimer>
#include <QTextDocument>
#include <QX11Info>
@ -187,6 +188,17 @@ void FdoSelectionManager::onClaimedOwnership()
qCDebug(SNIPROXY) << "Manager selection claimed";
setSystemTrayVisual();
// send all container windows to background on KWin restart
QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QStringLiteral("org.kde.KWin"), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForRegistration, this);
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, [=](const QString &) {
// some delay is necesary
QTimer::singleShot(100, this, [=]() {
for (auto sniproxy : m_proxies) {
sniproxy->stackContainerWindow(XCB_STACK_MODE_BELOW);
}
});
});
}
void FdoSelectionManager::onFailedToClaimOwnership()

@ -122,8 +122,7 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject* parent):
*/
#ifndef VISUAL_DEBUG
const uint32_t stackBelowData[] = {XCB_STACK_MODE_BELOW};
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData);
stackContainerWindow(XCB_STACK_MODE_BELOW);
NETWinInfo wm(c, m_containerWid, screen->root, NET::Properties(), NET::Properties2());
wm.setOpacity(0);
@ -214,6 +213,13 @@ void SNIProxy::update()
emit NewToolTip();
}
void SNIProxy::stackContainerWindow(const uint32_t stackMode) const
{
auto c = QX11Info::connection();
const uint32_t stackData[] = {stackMode};
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackData);
}
QSize SNIProxy::calculateClientWindowSize() const
{
auto c = QX11Info::connection();
@ -538,8 +544,7 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y)
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, configVals);
//pull window up
const uint32_t stackAboveData[] = {XCB_STACK_MODE_ABOVE};
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData);
stackContainerWindow(XCB_STACK_MODE_ABOVE);
//mouse down
if (m_injectMode == Direct) {
@ -589,7 +594,6 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y)
}
#ifndef VISUAL_DEBUG
const uint32_t stackBelowData[] = {XCB_STACK_MODE_BELOW};
xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData);
stackContainerWindow(XCB_STACK_MODE_BELOW);
#endif
}

@ -49,6 +49,7 @@ public:
~SNIProxy() override;
void update();
void stackContainerWindow(const uint32_t stackMode) const;
/**
* @return the category of the application associated to this item

Loading…
Cancel
Save