Emit clientAdded for wayland clients
Emit the clientAdded() signal also for Wayland clients in order to unify the API of the Workspace class for different client types.
This commit is contained in:
parent
b4e271c664
commit
a17a86999b
17 changed files with 83 additions and 107 deletions
|
@ -120,7 +120,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient_data()
|
|||
|
||||
void TestDbusInterface::testGetWindowInfoXdgShellClient()
|
||||
{
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
|
||||
QScopedPointer<Surface> surface(Test::createSurface());
|
||||
|
|
|
@ -260,7 +260,7 @@ void TestIdleInhibition::testDontInhibitWhenUnmapped()
|
|||
QVERIFY(inhibitor->isValid());
|
||||
|
||||
// Map the client.
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::blue);
|
||||
QVERIFY(clientAddedSpy.isEmpty());
|
||||
|
|
|
@ -122,7 +122,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
|
|||
QVERIFY(leftSpy.isValid());
|
||||
|
||||
// now create the two windows and make them overlap
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface1 = Test::createSurface(Test::waylandCompositor());
|
||||
QVERIFY(surface1);
|
||||
|
|
|
@ -226,7 +226,7 @@ void LockScreenTest::testStackingOrder()
|
|||
{
|
||||
// This test verifies that the lockscreen greeter is placed above other windows.
|
||||
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
|
||||
LOCK
|
||||
|
|
|
@ -273,7 +273,7 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
|
|||
QVERIFY(plasmaWindowCreatedSpy.isValid());
|
||||
|
||||
// this time we use a QSignalSpy on XdgShellClient as it'a a little bit more complex setup
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
// lock
|
||||
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate);
|
||||
|
|
|
@ -209,7 +209,7 @@ void PointerInputTest::testWarpingUpdatesFocus()
|
|||
QVERIFY(leftSpy.isValid());
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -257,7 +257,7 @@ void PointerInputTest::testWarpingGeneratesPointerMotion()
|
|||
QVERIFY(movedSpy.isValid());
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -297,7 +297,7 @@ void PointerInputTest::testWarpingDuringFilter()
|
|||
Cursors::self()->mouse()->setPos(10, 10);
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -340,7 +340,7 @@ void PointerInputTest::testUpdateFocusAfterScreenChange()
|
|||
QVERIFY(enteredSpy.isValid());
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -436,7 +436,7 @@ void PointerInputTest::testModifierClickUnrestrictedMove()
|
|||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove);
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -503,7 +503,7 @@ void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled(
|
|||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove);
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -576,7 +576,7 @@ void PointerInputTest::testModifierScrollOpacity()
|
|||
workspace()->slotReconfigure();
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -635,7 +635,7 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
|
|||
workspace()->slotReconfigure();
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -685,7 +685,7 @@ void PointerInputTest::testScrollAction()
|
|||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
// create two windows
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface1 = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface1);
|
||||
|
@ -745,7 +745,7 @@ void PointerInputTest::testFocusFollowsMouse()
|
|||
QCOMPARE(options->delayFocusInterval(), 200);
|
||||
|
||||
// create two windows
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface1 = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface1);
|
||||
|
@ -831,7 +831,7 @@ void PointerInputTest::testMouseActionInactiveWindow()
|
|||
workspace()->slotReconfigure();
|
||||
|
||||
// create two windows
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface1 = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface1);
|
||||
|
@ -921,7 +921,7 @@ void PointerInputTest::testMouseActionActiveWindow()
|
|||
QCOMPARE(options->isClickRaise(), clickRaise);
|
||||
|
||||
// create two windows
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface1 = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface1);
|
||||
|
@ -1003,7 +1003,7 @@ void PointerInputTest::testCursorImage()
|
|||
QVERIFY(!fallbackCursor.isNull());
|
||||
|
||||
// create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -1104,7 +1104,7 @@ void PointerInputTest::testEffectOverrideCursorImage()
|
|||
QVERIFY(!fallback.isNull());
|
||||
|
||||
// now let's create a window
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -1180,7 +1180,7 @@ void PointerInputTest::testPopup()
|
|||
|
||||
Cursors::self()->mouse()->setPos(800, 800);
|
||||
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -1261,7 +1261,7 @@ void PointerInputTest::testDecoCancelsPopup()
|
|||
QVERIFY(motionSpy.isValid());
|
||||
|
||||
Cursors::self()->mouse()->setPos(800, 800);
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
@ -1338,7 +1338,7 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed()
|
|||
QVERIFY(leftSpy.isValid());
|
||||
|
||||
Cursors::self()->mouse()->setPos(800, 800);
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
Surface *surface = Test::createSurface(m_compositor);
|
||||
QVERIFY(surface);
|
||||
|
|
|
@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "abstract_client.h"
|
||||
#include "screenlockerwatcher.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include <KWayland/Client/compositor.h>
|
||||
#include <KWayland/Client/connection_thread.h>
|
||||
|
@ -64,7 +65,7 @@ namespace Test
|
|||
static struct {
|
||||
ConnectionThread *connection = nullptr;
|
||||
EventQueue *queue = nullptr;
|
||||
Compositor *compositor = nullptr;
|
||||
KWayland::Client::Compositor *compositor = nullptr;
|
||||
SubCompositor *subCompositor = nullptr;
|
||||
ServerSideDecorationManager *decoration = nullptr;
|
||||
ShadowManager *shadowManager = nullptr;
|
||||
|
@ -283,7 +284,7 @@ ConnectionThread *waylandConnection()
|
|||
return s_waylandConnection.connection;
|
||||
}
|
||||
|
||||
Compositor *waylandCompositor()
|
||||
KWayland::Client::Compositor *waylandCompositor()
|
||||
{
|
||||
return s_waylandConnection.compositor;
|
||||
}
|
||||
|
@ -401,7 +402,7 @@ void render(Surface *surface, const QImage &img)
|
|||
|
||||
AbstractClient *waitForWaylandWindowShown(int timeout)
|
||||
{
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
if (!clientAddedSpy.isValid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -413,7 +414,7 @@ AbstractClient *waitForWaylandWindowShown(int timeout)
|
|||
|
||||
AbstractClient *renderAndWaitForShown(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format, int timeout)
|
||||
{
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
if (!clientAddedSpy.isValid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ void TestXdgShellClient::testMapUnmap()
|
|||
QScopedPointer<XdgShellSurface> shellSurface(
|
||||
Test::createXdgShellStableSurface(surface.data(), nullptr, Test::CreationSetup::CreateOnly));
|
||||
|
||||
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
|
||||
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
|
||||
|
@ -878,8 +878,8 @@ void TestXdgShellClient::testUnresponsiveWindow()
|
|||
// for this an external binary is launched
|
||||
const QString kill = QFINDTESTDATA(QStringLiteral("kill"));
|
||||
QVERIFY(!kill.isEmpty());
|
||||
QSignalSpy shellClientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QVERIFY(shellClientAddedSpy.isValid());
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
|
||||
QScopedPointer<QProcess> process(new QProcess);
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
|
@ -907,12 +907,12 @@ void TestXdgShellClient::testUnresponsiveWindow()
|
|||
QVERIFY(processStartedSpy.wait());
|
||||
|
||||
AbstractClient *killClient = nullptr;
|
||||
if (shellClientAddedSpy.isEmpty()) {
|
||||
QVERIFY(shellClientAddedSpy.wait());
|
||||
if (clientAddedSpy.isEmpty()) {
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
}
|
||||
::kill(process->processId(), SIGUSR1); // send a signal to freeze the process
|
||||
|
||||
killClient = shellClientAddedSpy.first().first().value<AbstractClient*>();
|
||||
killClient = clientAddedSpy.first().first().value<AbstractClient*>();
|
||||
QVERIFY(killClient);
|
||||
QSignalSpy unresponsiveSpy(killClient, &AbstractClient::unresponsiveChanged);
|
||||
QSignalSpy killedSpy(process.data(), static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished));
|
||||
|
|
|
@ -112,8 +112,6 @@ void XwaylandSelectionsTest::testSync()
|
|||
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
QSignalSpy shellClientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
|
||||
QVERIFY(shellClientAddedSpy.isValid());
|
||||
QSignalSpy clipboardChangedSpy(Xwl::DataBridge::self()->dataDeviceIface(), &KWaylandServer::DataDeviceInterface::selectionChanged);
|
||||
QVERIFY(clipboardChangedSpy.isValid());
|
||||
|
||||
|
@ -131,13 +129,8 @@ void XwaylandSelectionsTest::testSync()
|
|||
QVERIFY(m_copyProcess->waitForStarted());
|
||||
|
||||
AbstractClient *copyClient = nullptr;
|
||||
if (copyPlatform == QLatin1String("xcb")) {
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
copyClient = clientAddedSpy.first().first().value<AbstractClient*>();
|
||||
} else {
|
||||
QVERIFY(shellClientAddedSpy.wait());
|
||||
copyClient = shellClientAddedSpy.first().first().value<AbstractClient*>();
|
||||
}
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
copyClient = clientAddedSpy.first().first().value<AbstractClient *>();
|
||||
QVERIFY(copyClient);
|
||||
if (workspace()->activeClient() != copyClient) {
|
||||
workspace()->activateClient(copyClient);
|
||||
|
@ -166,15 +159,9 @@ void XwaylandSelectionsTest::testSync()
|
|||
QVERIFY(m_pasteProcess->waitForStarted());
|
||||
|
||||
AbstractClient *pasteClient = nullptr;
|
||||
if (pastePlatform == QLatin1String("xcb")) {
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
pasteClient = clientAddedSpy.last().first().value<AbstractClient*>();
|
||||
} else {
|
||||
QVERIFY(shellClientAddedSpy.wait());
|
||||
pasteClient = shellClientAddedSpy.last().first().value<AbstractClient*>();
|
||||
}
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
pasteClient = clientAddedSpy.last().first().value<AbstractClient *>();
|
||||
QCOMPARE(clientAddedSpy.count(), 1);
|
||||
QCOMPARE(shellClientAddedSpy.count(), 1);
|
||||
QVERIFY(pasteClient);
|
||||
|
||||
if (workspace()->activeClient() != pasteClient) {
|
||||
|
|
|
@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "main.h"
|
||||
#include "scene.h"
|
||||
#include "unmanaged.h"
|
||||
#include "waylandclient.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "keyboard_input.h"
|
||||
|
@ -876,40 +877,15 @@ DebugConsoleModel::DebugConsoleModel(QObject *parent)
|
|||
if (waylandServer()) {
|
||||
const auto clients = waylandServer()->clients();
|
||||
for (auto c : clients) {
|
||||
m_waylandClients.append(c);
|
||||
handleClientAdded(c);
|
||||
}
|
||||
// TODO: that only includes windows getting shown, not those which are only created
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this,
|
||||
[this] (AbstractClient *c) {
|
||||
add(s_waylandClientId -1, m_waylandClients, c);
|
||||
}
|
||||
);
|
||||
connect(waylandServer(), &WaylandServer::shellClientRemoved, this,
|
||||
[this] (AbstractClient *c) {
|
||||
remove(s_waylandClientId -1, m_waylandClients, c);
|
||||
}
|
||||
);
|
||||
}
|
||||
const auto x11Clients = workspace()->clientList();
|
||||
for (auto c : x11Clients) {
|
||||
m_x11Clients.append(c);
|
||||
handleClientAdded(c);
|
||||
}
|
||||
connect(workspace(), &Workspace::clientAdded, this,
|
||||
[this] (AbstractClient *client) {
|
||||
if (X11Client *x11Client = qobject_cast<X11Client *>(client)) {
|
||||
add(s_x11ClientId -1, m_x11Clients, x11Client);
|
||||
}
|
||||
}
|
||||
);
|
||||
connect(workspace(), &Workspace::clientRemoved, this,
|
||||
[this] (AbstractClient *ac) {
|
||||
X11Client *c = qobject_cast<X11Client *>(ac);
|
||||
if (!c) {
|
||||
return;
|
||||
}
|
||||
remove(s_x11ClientId -1, m_x11Clients, c);
|
||||
}
|
||||
);
|
||||
connect(workspace(), &Workspace::clientAdded, this, &DebugConsoleModel::handleClientAdded);
|
||||
connect(workspace(), &Workspace::clientRemoved, this, &DebugConsoleModel::handleClientRemoved);
|
||||
|
||||
const auto unmangeds = workspace()->unmanagedList();
|
||||
for (auto u : unmangeds) {
|
||||
|
@ -940,6 +916,36 @@ DebugConsoleModel::DebugConsoleModel(QObject *parent)
|
|||
);
|
||||
}
|
||||
|
||||
void DebugConsoleModel::handleClientAdded(AbstractClient *client)
|
||||
{
|
||||
X11Client *x11Client = qobject_cast<X11Client *>(client);
|
||||
if (x11Client) {
|
||||
add(s_x11ClientId - 1, m_x11Clients, x11Client);
|
||||
return;
|
||||
}
|
||||
|
||||
WaylandClient *waylandClient = qobject_cast<WaylandClient *>(client);
|
||||
if (waylandClient) {
|
||||
add(s_waylandClientId - 1, m_waylandClients, waylandClient);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void DebugConsoleModel::handleClientRemoved(AbstractClient *client)
|
||||
{
|
||||
X11Client *x11Client = qobject_cast<X11Client *>(client);
|
||||
if (x11Client) {
|
||||
remove(s_x11ClientId - 1, m_x11Clients, x11Client);
|
||||
return;
|
||||
}
|
||||
|
||||
WaylandClient *waylandClient = qobject_cast<WaylandClient *>(client);
|
||||
if (waylandClient) {
|
||||
remove(s_waylandClientId - 1, m_waylandClients, waylandClient);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DebugConsoleModel::~DebugConsoleModel() = default;
|
||||
|
||||
int DebugConsoleModel::columnCount(const QModelIndex &parent) const
|
||||
|
@ -1241,7 +1247,7 @@ static T *clientForIndex(const QModelIndex &index, const QVector<T*> &clients, i
|
|||
return clients.at(row);
|
||||
}
|
||||
|
||||
AbstractClient *DebugConsoleModel::waylandClient(const QModelIndex &index) const
|
||||
WaylandClient *DebugConsoleModel::waylandClient(const QModelIndex &index) const
|
||||
{
|
||||
return clientForIndex(index, m_waylandClients, s_waylandClientId);
|
||||
}
|
||||
|
@ -1285,14 +1291,6 @@ SurfaceTreeModel::SurfaceTreeModel(QObject *parent)
|
|||
}
|
||||
connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
}
|
||||
if (waylandServer()) {
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this,
|
||||
[this, reset] (AbstractClient *c) {
|
||||
connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
reset();
|
||||
}
|
||||
);
|
||||
}
|
||||
connect(workspace(), &Workspace::clientAdded, this,
|
||||
[this, reset] (AbstractClient *c) {
|
||||
if (c->surface()) {
|
||||
|
|
|
@ -44,6 +44,7 @@ class X11Client;
|
|||
class InternalClient;
|
||||
class Unmanaged;
|
||||
class DebugConsoleFilter;
|
||||
class WaylandClient;
|
||||
|
||||
class KWIN_EXPORT DebugConsoleModel : public QAbstractItemModel
|
||||
{
|
||||
|
@ -59,6 +60,10 @@ public:
|
|||
int rowCount(const QModelIndex &parent) const override;
|
||||
QModelIndex parent(const QModelIndex &child) const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleClientAdded(AbstractClient *client);
|
||||
void handleClientRemoved(AbstractClient *client);
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
QModelIndex indexForClient(int row, int column, const QVector<T*> &clients, int id) const;
|
||||
|
@ -73,13 +78,13 @@ private:
|
|||
void add(int parentRow, QVector<T*> &clients, T *client);
|
||||
template <class T>
|
||||
void remove(int parentRow, QVector<T*> &clients, T *client);
|
||||
AbstractClient *waylandClient(const QModelIndex &index) const;
|
||||
WaylandClient *waylandClient(const QModelIndex &index) const;
|
||||
InternalClient *internalClient(const QModelIndex &index) const;
|
||||
X11Client *x11Client(const QModelIndex &index) const;
|
||||
Unmanaged *unmanaged(const QModelIndex &index) const;
|
||||
int topLevelRowCount() const;
|
||||
|
||||
QVector<AbstractClient *> m_waylandClients;
|
||||
QVector<WaylandClient *> m_waylandClients;
|
||||
QVector<InternalClient*> m_internalClients;
|
||||
QVector<X11Client *> m_x11Clients;
|
||||
QVector<Unmanaged*> m_unmanageds;
|
||||
|
|
|
@ -258,12 +258,6 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
|||
setupClientConnections(client);
|
||||
}
|
||||
if (auto w = waylandServer()) {
|
||||
connect(w, &WaylandServer::shellClientAdded, this, [this](AbstractClient *c) {
|
||||
if (c->readyForPainting())
|
||||
slotClientShown(c);
|
||||
else
|
||||
connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown);
|
||||
});
|
||||
const auto clients = waylandServer()->clients();
|
||||
for (AbstractClient *c : clients) {
|
||||
if (c->readyForPainting()) {
|
||||
|
|
|
@ -163,7 +163,6 @@ void PointerInputRedirection::init()
|
|||
const auto clients = workspace()->allClientList();
|
||||
std::for_each(clients.begin(), clients.end(), setupMoveResizeConnection);
|
||||
connect(workspace(), &Workspace::clientAdded, this, setupMoveResizeConnection);
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, setupMoveResizeConnection);
|
||||
|
||||
// warp the cursor to center of screen
|
||||
warp(screens()->geometry().center());
|
||||
|
@ -964,7 +963,6 @@ CursorImage::CursorImage(PointerInputRedirection *parent)
|
|||
const auto clients = workspace()->allClientList();
|
||||
std::for_each(clients.begin(), clients.end(), setupMoveResizeConnection);
|
||||
connect(workspace(), &Workspace::clientAdded, this, setupMoveResizeConnection);
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, setupMoveResizeConnection);
|
||||
loadThemeCursor(Qt::ArrowCursor, &m_fallbackCursor);
|
||||
|
||||
m_surfaceRenderedTimer.start();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "popup_input_filter.h"
|
||||
#include "abstract_client.h"
|
||||
#include "deleted.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace KWin
|
|||
PopupInputFilter::PopupInputFilter()
|
||||
: QObject()
|
||||
{
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, &PopupInputFilter::handleClientAdded);
|
||||
connect(workspace(), &Workspace::clientAdded, this, &PopupInputFilter::handleClientAdded);
|
||||
}
|
||||
|
||||
void PopupInputFilter::handleClientAdded(Toplevel *client)
|
||||
|
|
|
@ -47,9 +47,6 @@ ClientLevel::ClientLevel(ClientModel *model, AbstractLevel *parent)
|
|||
connect(Workspace::self(), &Workspace::clientAdded, this, &ClientLevel::clientAdded);
|
||||
connect(Workspace::self(), &Workspace::clientRemoved, this, &ClientLevel::clientRemoved);
|
||||
connect(model, SIGNAL(exclusionsChanged()), SLOT(reInit()));
|
||||
if (waylandServer()) {
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, &ClientLevel::clientAdded);
|
||||
}
|
||||
}
|
||||
|
||||
ClientLevel::~ClientLevel()
|
||||
|
|
|
@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "../x11client.h"
|
||||
#include "../outline.h"
|
||||
#include "../screens.h"
|
||||
#include "../xdgshellclient.h"
|
||||
#include "../virtualdesktops.h"
|
||||
#include "../wayland_server.h"
|
||||
#include "../workspace.h"
|
||||
|
@ -67,10 +66,6 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
|
|||
}
|
||||
);
|
||||
connect(QApplication::desktop(), SIGNAL(resized(int)), SIGNAL(screenResized(int)));
|
||||
if (waylandServer()) {
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::clientAdded);
|
||||
connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::setupClientConnections);
|
||||
}
|
||||
foreach (KWin::X11Client *client, ws->clientList()) {
|
||||
setupClientConnections(client);
|
||||
}
|
||||
|
|
|
@ -752,6 +752,7 @@ void Workspace::addShellClient(AbstractClient *client)
|
|||
updateStackingOrder(true);
|
||||
updateClientArea();
|
||||
});
|
||||
emit clientAdded(client);
|
||||
}
|
||||
|
||||
void Workspace::removeShellClient(AbstractClient *client)
|
||||
|
|
Loading…
Reference in a new issue