[kwin_wayland] Create a dedicated class for Compositor
Wraps the compositor interface.
This commit is contained in:
parent
0ab135a77c
commit
db490f0d1b
1 changed files with 8 additions and 6 deletions
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// Qt
|
// Qt
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
// KWin
|
// KWin
|
||||||
|
#include "../../wayland_client/compositor.h"
|
||||||
#include "../../wayland_client/connection_thread.h"
|
#include "../../wayland_client/connection_thread.h"
|
||||||
#include "../../wayland_client/shell.h"
|
#include "../../wayland_client/shell.h"
|
||||||
#include "../../wayland_client/surface.h"
|
#include "../../wayland_client/surface.h"
|
||||||
|
@ -147,14 +148,16 @@ void TestWaylandShell::testShell()
|
||||||
if (compositorSpy.isEmpty()) {
|
if (compositorSpy.isEmpty()) {
|
||||||
QVERIFY(compositorSpy.wait());
|
QVERIFY(compositorSpy.wait());
|
||||||
}
|
}
|
||||||
wl_compositor *compositor = registry.bindCompositor(compositorSpy.first().first().value<quint32>(), compositorSpy.first().last().value<quint32>());
|
KWin::Wayland::Compositor compositor;
|
||||||
|
compositor.setup(registry.bindCompositor(compositorSpy.first().first().value<quint32>(), compositorSpy.first().last().value<quint32>()));
|
||||||
|
|
||||||
KWin::Wayland::Shell shell;
|
KWin::Wayland::Shell shell;
|
||||||
shell.setup(registry.bindShell(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
|
shell.setup(registry.bindShell(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
|
||||||
wl_display_flush(connection.display());
|
wl_display_flush(connection.display());
|
||||||
KWin::Wayland::Surface s;
|
QScopedPointer<KWin::Wayland::Surface> s(compositor.createSurface());
|
||||||
s.setup(wl_compositor_create_surface(compositor));
|
QVERIFY(!s.isNull());
|
||||||
KWin::Wayland::ShellSurface *surface = shell.createSurface(&s, &shell);
|
QVERIFY(s->isValid());
|
||||||
|
KWin::Wayland::ShellSurface *surface = shell.createSurface(s.data(), &shell);
|
||||||
QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize)));
|
QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize)));
|
||||||
QVERIFY(sizeSpy.isValid());
|
QVERIFY(sizeSpy.isValid());
|
||||||
QCOMPARE(surface->size(), QSize());
|
QCOMPARE(surface->size(), QSize());
|
||||||
|
@ -170,8 +173,7 @@ void TestWaylandShell::testShell()
|
||||||
shell.release();
|
shell.release();
|
||||||
QVERIFY(!surface->isValid());
|
QVERIFY(!surface->isValid());
|
||||||
|
|
||||||
s.release();
|
compositor.release();
|
||||||
wl_compositor_destroy(compositor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_MAIN(TestWaylandShell)
|
QTEST_MAIN(TestWaylandShell)
|
||||||
|
|
Loading…
Reference in a new issue